From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16308 invoked by alias); 26 Nov 2012 13:28:08 -0000 Received: (qmail 16222 invoked by uid 48); 26 Nov 2012 13:27:46 -0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/51242] [C++11] Unable to use strongly typed enums as bit fields Date: Mon, 26 Nov 2012 13:28:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: paolo.carlini at oracle dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02396.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51242 --- Comment #21 from Paolo Carlini 2012-11-26 13:27:45 UTC --- Uhm, actually, when the underlying type is unscoped and we already accept the code, we warn exactly in the same way. I'm not sure if this is already clear to everybody, definitely wasn't clear to me, sorry if I misled you Jon or somebody else into thinking that the possible issues having to do with -Wnarrowing were important for this issue, I understand now they are not: enum MyEnum { A1 = 1, A2 = 2 }; struct MyClass { MyEnum Field1 : 1; }; Thus, it really seems the fix for this issue boils down to loosening the check in grokbitfield and that's it.