This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51242] [C++11] Unable to use strongly typed enums as bit fields
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 20 Nov 2011 20:26:58 +0000
- Subject: [Bug c++/51242] [C++11] Unable to use strongly typed enums as bit fields
- Auto-submitted: auto-generated
- References: <bug-51242-4@http.gcc.gnu.org/bugzilla/>
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?