[Bug c++/101107] Misleading error message in aggregate initialization in CRTP base class

2021-06-27 Thread btzy1996 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101107

--- Comment #2 from Bernard Teo  ---
Hmm, I didn't realise it was brace elision - the error makes much more sense
this way.  Reporting the assumption (e.g. "`A` can't be initialized from
`*this`, assuming brace elision") would solve the problem.  In my opinion the
important part of the message is that "`A` can't be initialized from `*this`" -
just that part should point the programmer in the right direction.

[Bug c++/101107] Misleading error message in aggregate initialization in CRTP base class

2021-06-22 Thread rs2740 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101107

TC  changed:

   What|Removed |Added

 CC||rs2740 at gmail dot com

--- Comment #1 from TC  ---
Since `*this` can't initialize an `A`, it's assuming brace elision. Not sure
how the diagnostic can be made clearer though...perhaps it can report that
assumption?