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++/51242] [C++11] Unable to use strongly typed enums as bit fields


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |jason at gcc dot gnu.org
            Summary|Unable to use strongly      |[C++11] Unable to use
                   |typed enums as bit fields   |strongly typed enums as bit
                   |                            |fields

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-11-20 20:26:58 UTC ---
In future please provide a complete testcase, as requested at
http://gcc.gnu.org/bugs

Testcase reduced from the one you posted to the gcc-help list:

enum class MyEnum { A = 1 };

struct MyClass
{
  MyEnum Field1 : 3;
};


Jason, the standard seems to say this should work, although I am rather
surprised - is that intended?


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