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: Mon, 28 May 2012 16:21:24 +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 #9 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-28 16:21:24 UTC ---
4.6 gets the error right, what you're doing is equivalent to:
struct pair
{
pair(const char*, int) { }
};
struct array
{
pair data[1];
};
array a { { "smile", 1 } };
And that isn't valid. The error 4.6 gives for that is:
t.cc:11:26: error: too many initializers for 'pair [1]'
t.cc:11:26: error: could not convert '(const char*)"smile"' from 'const char*'
to 'pair'
Which is very similar to the error 4.6 gives for your original code, except he
types in your original are more complicated because they involve templates and
typedefs.