[Bug c++/95085] diagnostic on designated-initializer from braced-init-list could be better

2021-08-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95085

Andrew Pinski  changed:

   What|Removed |Added

 CC||hewillk at gmail dot com

--- Comment #2 from Andrew Pinski  ---
*** Bug 101818 has been marked as a duplicate of this bug. ***

[Bug c++/95085] diagnostic on designated-initializer from braced-init-list could be better

2020-05-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95085

Jonathan Wakely  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Keywords||diagnostic
   Last reconfirmed||2020-05-12

--- Comment #1 from Jonathan Wakely  ---
There is a related problem without designated initializers:

struct A { A(int); };
int f(A);
int i = f(A(nullptr));
int j = f(A{nullptr});

d.cc:3:20: error: no matching function for call to 'A::A(std::nullptr_t)'
...
d.cc:4:20: error: no matching function for call to 'A::A()'
...

It also seems inconsistent to say "initializer list argument" in one place and 
"" in another, although maybe the latter is
because it's inside a quoted C++ expression, not prose.