This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51805] New: Invalid list-initialization accepted
- From: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 09 Jan 2012 21:33:55 +0000
- Subject: [Bug c++/51805] New: Invalid list-initialization accepted
- Auto-submitted: auto-generated
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.