This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54074] [C++0x] initializer list accepts incorrect nested input


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54074

Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-07-24 11:00:23 UTC ---
Strictly speaking you are right that this should be ill-formed as of the C++11
wording. This is due to the fact that [dcl.init.aggr] p11 allows brace-elision
*only* for the specific initializer form

S2 s22 = { 3, "Hello3", 4,"Hello4" };  

(Note the '=' sign). But there is a core-issue

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1270

that has now ready state and that will make the code example well-formed again.
This new rule has already been implemented by gcc and I don' think that this
should be changed. Note also, that by using the good old aggregate
initialization

S2 s22 = { 3, "Hello3", 4,"Hello4" };  

mentioned above is OK even even in C++03, so I think that the 1270 P/R is just
the right way to ensure more consistency.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]