This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53494] [4.7/4.8 Regression] ICE with invalid initializer list
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 May 2012 08:17:07 +0000
- Subject: [Bug c++/53494] [4.7/4.8 Regression] ICE with invalid initializer list
- Auto-submitted: auto-generated
- References: <bug-53494-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53494
--- Comment #19 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-30 08:17:07 UTC ---
(In reply to comment #13)
> Am I interpreting correctly that double braces are /required/ for std::array
> init lists but only when the subtype has has a multivariable initializer too?
>
> ..????
Yes. Double braces are always correct and always allowed, but you can omit
them if the result is unambiguous, e.g. array<int,3>{1,2,3} is equivalent to
array<int,3>{{1,2,3}}
But if the array's value_type is to be initialized with a
braced-initializer-list then you need a completely-braced initialization so
that the initializer-list for the value_type doesn't get interpreted as an
initializer for the value_type[N] array.
It still shouldn't crash the compiler though :)