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

--- Comment #18 from Daniel Krügler <daniel.kruegler at googlemail dot com> 
2012-05-30 06:25:27 UTC ---
(In reply to comment #16)
> "If the initializer-list begins with a left brace,"
> 
> which it does
> 
> "then the succeeding comma-separated list of initializer-clauses initializes
> the members of a subaggregate;"
> 
> I read that to mean that { "smile", 1 } initializes the pair[1]
> 
> "it is erroneous for there to be more initializer-clauses than members."
> 
> There is only one member of pair[1] but two initializer-clauses.
> 
> So I think the error is required, but Daniel is usually right about such 
> things
> so I'm not certain :)

Thanks Jon. I agree with you, the wording seems clear. This looks like a very
unfortunate language rule, because it leads to an inconsistency (from the
user-point), when comparing this with non-aggregate list-initialization as in
the following case:

std::initializer_list<std::pair<std::string, unsigned>> lp = { {"a", 1} };

which is well-formed. I would like to withdraw my concerns expressed in comment
14 so that there is no hindrance to close this issue - anything else seems to
belong to a discussion at another place.

Reply via email to