This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50671] New: NSDMI not parsed correctly for multiple-data-member declarations


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]