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++/53494] [4.7/4.8 Regression] ICE with invalid initializer list


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.


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