https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107463
Bug ID: 107463 Summary: Better error request for invalid initializer list of aggregate Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nightstrike at gmail dot com Target Milestone: --- struct S { struct Config { int x; }; S(Config const & cfg); }; void f() { S s({ .y = "x" }); } results in: <source>: In function 'void f()': <source>:11:6: error: no matching function for call to 'S::S(<brace-enclosed initializer list>)' 11 | }); | ^ <source>:5:5: note: candidate: 'S::S(const Config&)' 5 | S(Config const & cfg); | ^ <source>:5:22: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const S::Config&' 5 | S(Config const & cfg); | ~~~~~~~~~~~~~~~^~~ <source>:1:8: note: candidate: 'constexpr S::S(const S&)' 1 | struct S { | ^ <source>:1:8: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const S&' <source>:1:8: note: candidate: 'constexpr S::S(S&&)' <source>:1:8: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'S&&' It would be a lot more helpful if the error was something like "there's no member named y in Config, did you mean x?" PR71542 seems related, but different.