Hi Jonathan,

Thanks for the quick answer. No, it doesn't for the simplest possible case:

    #include <tuple>

    int main() { std::array<int,1> arr; };

But admittedly that would have been a surprise to me as I usually compile with -Wall -Wextra -Werror.

But I tried to replace `<array>` with `<tuple>` in yet another code (tiny but real-life, so not as trivial as above) with two appearances of `std::array` and there, one does yield the note.

I boiled it down to the following: The typename seems to not yield the note but the constructor does notify, i.e. in

    1 std::array<int,1> f() {

    2    return std::array<int,1>{{1}};

    3 }

Line 1 and 2 raise an error but only Line 2 comes with a note.

Best,

Julian


On 05/08/2022 17:55, Jonathan Wakely wrote:
On Fri, 5 Aug 2022 at 17:39, Julian Lenz via Gcc <gcc@gcc.gnu.org> wrote:
Hi everybody,

TL;DR:

What is the reason that `error: '<some class>' has incomplete type` does
not give a note about where the forward declaration happened for
standard library classes?
Probably because the declaration happens in a system header.

Does -Wsystem-headers change it?

Reply via email to