This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50671] New: NSDMI not parsed correctly for multiple-data-member declarations
- From: "miles at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 09 Oct 2011 08:27:29 +0000
- Subject: [Bug c++/50671] New: NSDMI not parsed correctly for multiple-data-member declarations
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50671
Bug #: 50671
Summary: NSDMI not parsed correctly for multiple-data-member
declarations
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: miles@gnu.org
The new NSDMI support seems to work generally, but the following gives a syntax
error:
struct X { int i = 3, j = 4; };
$ g++-snapshot -c -std=c++0x i.cc
i.cc:1:21: error: expected ';' before ',' token
It certainly seems like this _should_ be valid code, and the clang trunk
compiles it fine.
If I split the declaration, like "struct X { int i = 3; int j = 4; }", gcc
compiles it as expected.
$ g++-snapshot --version
g++ (Debian 20111008-1) 4.7.0 20111008 (experimental) [trunk revision 179709]
Thanks,
-miles