New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 637183 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Enable clang plugin "check-enum-unsigned-bitfields" flag by default

Project Member Reported by sashab@chromium.org, Aug 12 2016

Issue description

https://chromium.googlesource.com/chromium/src/+/master/docs/clang.md says to implement all new clang plugins behind a flag for at least one clang roll.

The flag check-enum-unsigned-bitfields enables a check for enums used in bitfields. Enum bitfields should use unsigned as the underlying type to prevent strange behavior in MSVC.

Design Doc (in context of ComputedStyle):
https://docs.google.com/document/d/1BfjMEXIzvY1WZEn_nESBxyqkazkfa0sBSEvm-F89YwM/edit

Discussion on style-dev:
https://www.google.com/url?hl=en&q=https://groups.google.com/a/chromium.org/d/msgid/style-dev/CADAgNurPp47TyFcws6LAyY%253DAxT5RpRb0MkAWJ_G3J2oL0Uj-mg%2540mail.gmail.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1471065087985000&usg=AFQjCNGjo6xUygkhjxGo90tVmjGrlm6MiA).


Allowing enums in bitfields has the advantage of saving space while not having to use static casts when reading from/writing to the bitfield, as well as not having to match the correct underlying type (signed/unsigned) when deciding the field to store.
 

Comment 1 by sashab@chromium.org, Aug 12 2016

Labels: -Type-Bug Type-Feature

Comment 2 by sashab@chromium.org, Aug 12 2016

Description: Show this description

Comment 3 by sashab@chromium.org, Aug 12 2016

Description: Show this description
Components: -Blink Blink>Internals

Comment 5 by sashab@chromium.org, Nov 17 2016

Status: WontFix (was: Started)
Invalid; now we are implementing this in Clang directly as a path in crbug.com/648462.

Sign in to add a comment