[Bug c++/51805] New: Invalid list-initialization accepted
schaub.johannes at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jan 9 21:34:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51805
Bug #: 51805
Summary: Invalid list-initialization accepted
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
Either I'm missing something or GCC should reject this code according to
13.3.3.1p4 (the initializer-list constructor is non-viable and the copy/move
constructors would require user defined conversions respectively to accept "{1,
2, 3}"):
struct A { A(initializer_list<int>); }; A a{{1, 2, 3}};
People were initializing their vectors using "{{1, 2, 3}}", perhaps they are
used to do such by following the analogous "array<>" initialization notion.
More information about the Gcc-bugs
mailing list