[Bug c++/80920] warnings get position wrong - very confusing
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue May 30 16:07:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80920
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-05-30
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jason Vas Dias from comment #0)
> Incidentally, why should it be illegal to specify an initializer for
> an array of non-class types ? How else is one meant to ensure that
> all elements of A::_a[] are initialized to zero ? Must one put :
> memset(_a, '\0', sizeof(_a))
> inside the initializer - there is no other way ?
It's not illegal to specify an initializer, you just did it wrong.
Either of _a() or _a{} works fine. The former has always been valid, even in
C++98.
I'm fairly sure we already have a bug report for the location of the error, but
I can't find it now.
More information about the Gcc-bugs
mailing list