This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61414] enum class bitfield size-checking failure
- 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: Wed, 28 Sep 2016 23:04:28 +0000
- Subject: [Bug c++/61414] enum class bitfield size-checking failure
- Auto-submitted: auto-generated
- References: <bug-61414-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Xidorn Quan from comment #5)
> It seems G++ always throw that warning for enum class as bitfield, even when
> the enum class is actually empty:
> > enum class K {};
> > struct S {
> > K v : 5;
> > };
>
> G++ would give:
> > test.cpp:3:9: warning: 'S::v' is too small to hold all values of 'enum class K'
> > K v : 5;
Yes, read comment 2.