[Bug c++/85717] anonymous union in initializer list : do not handle the types correctly
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri May 11 12:42:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85717
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This behaviour is required by the C++ standard, GCC is not allowed to change
it.
In C++20 you will be able to use designated-initializers to select which me,ber
of the union to initialize:
t1 = { 1 ,"a", { .real=3.4 } } ;
t1 = { 1 ,"a", { .integer = 2 } } ;
More information about the Gcc-bugs
mailing list