This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51911] New: [C++11] G++ accepts new auto { list }
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 Jan 2012 06:26:38 +0000
- Subject: [Bug c++/51911] New: [C++11] G++ accepts new auto { list }
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51911
Bug #: 51911
Summary: [C++11] G++ accepts new auto { list }
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jason@gcc.gnu.org
If the auto type-specifier appears in the type-specifier-seq of a new-type-id
or type-id of a new-expression, the new-expression shall contain a
new-initializer of the form ( assignment-expression )
So this shouldn't compile:
#include <initializer_list>
int main()
{
auto foo = new auto {3, 4, 5};
}