https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127249

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-09-07
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Clang gets the location right:

def.cc:6:11: error: no matching constructor for initialization of 'NoDefault'
    6 |   Foo() : T(), inner() { }
      |           ^
def.cc:13:18: note: in instantiation of member function 'Foo<NoDefault>::Foo'
requested here
   13 |   Foo<NoDefault> f;
      |                  ^
def.cc:9:20: note: candidate constructor not viable: requires 1 argument, but 0
were provided
    9 | struct NoDefault { NoDefault(int) { } };
      |                    ^         ~~~
def.cc:9:8: note: candidate constructor (the implicit copy constructor) not
viable: requires 1 argument, but 0 were provided
    9 | struct NoDefault { NoDefault(int) { } };
      |        ^~~~~~~~~
def.cc:9:8: note: candidate constructor (the implicit move constructor) not
viable: requires 1 argument, but 0 were provided
    9 | struct NoDefault { NoDefault(int) { } };
      |        ^~~~~~~~~
1 error generated.



So does EDG:

"def.cc", line 6: error: no instance of constructor "NoDefault::NoDefault"
          matches the argument list
    Foo() : T(), inner() { }
             ^
"def.cc", line 9: note: number of parameters of function
          "NoDefault::NoDefault(const NoDefault &)" does not match the call
  struct NoDefault { NoDefault(int) { } };
         ^
"def.cc", line 9: note: number of parameters of function
          "NoDefault::NoDefault(NoDefault &&)" does not match the call
  struct NoDefault { NoDefault(int) { } };
         ^
"def.cc", line 9: note: number of parameters of function
          "NoDefault::NoDefault(int)" does not match the call
  struct NoDefault { NoDefault(int) { } };
                     ^
          detected during instantiation of "Foo<T, U...>::Foo() [with
                    T=NoDefault, U=<>]" at line 13

1 error detected in the compilation of "def.cc".

Reply via email to