[Bug c++/41127] [4.4/4.5 regression] unnamed bitfield declaration parser regression

bangerth at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 25 13:43:00 GMT 2009



------- Comment #1 from bangerth at gmail dot com  2009-08-25 13:43 -------
This is an interesting one:
------------------------
enum EE {ee};
struct D {
        enum EE : 8;
};
------------------------
In C++98, this looks like an unnamed bit field as part of struct D, but
with C++0x we apparently parse this as the beginning of an enum
scoped declaration:

g/x> /home/bangerth/bin/x86/gcc-mainline/bin/c++ -c x.cc
x.cc:3:14: warning: scoped enums only available with -std=c++0x or -std=gnu++0x
x.cc:3:19: error: expected type-specifier before numeric constant
x.cc:3:19: error: expected '{' before numeric constant
x.cc:3:19: error: expected class-key before numeric constant
x.cc:3:19: error: expected unqualified-id before numeric constant

This is a regression.

W.


-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com,
                   |                            |bangerth at gmail dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-08-25 13:43:14
               date|                            |
            Summary|unnamed bitfield declaration|[4.4/4.5 regression] unnamed
                   |parser regression           |bitfield declaration parser
                   |                            |regression


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41127



More information about the Gcc-bugs mailing list