Commit a81e00d5 authored by sashab's avatar sashab Committed by Commit bot

Fix bitfield enums to not trigger upcoming Clang warning

Fix bitfield enums to not trigger upcoming Clang warning regarding
non-unsigned enum bitfields producing non-portable code.

For more details, see the patch here: https://reviews.llvm.org/D24289

BUG=648462

Review-Url: https://codereview.chromium.org/2349153002
Cr-Commit-Position: refs/heads/master@{#39649}
parent 1ca44a0a
......@@ -90,10 +90,10 @@ struct StaticDstRangeRelationToSrcRange<Dst,
static const NumericRangeRepresentation value = NUMERIC_RANGE_NOT_CONTAINED;
};
enum RangeConstraint {
RANGE_VALID = 0x0, // Value can be represented by the destination type.
enum RangeConstraint : unsigned char {
RANGE_VALID = 0x0, // Value can be represented by the destination type.
RANGE_UNDERFLOW = 0x1, // Value would overflow.
RANGE_OVERFLOW = 0x2, // Value would underflow.
RANGE_OVERFLOW = 0x2, // Value would underflow.
RANGE_INVALID = RANGE_UNDERFLOW | RANGE_OVERFLOW // Invalid (i.e. NaN).
};
......
......@@ -1058,8 +1058,7 @@ enum InitializationFlag : uint8_t { kNeedsInitialization, kCreatedInitialized };
enum MaybeAssignedFlag : uint8_t { kNotAssigned, kMaybeAssigned };
// Serialized in PreparseData, so numeric values should not be changed.
enum ParseErrorType { kSyntaxError = 0, kReferenceError = 1 };
enum ParseErrorType : uint8_t { kSyntaxError = 0, kReferenceError = 1 };
enum MinusZeroMode {
TREAT_MINUS_ZERO_AS_ZERO,
......
......@@ -649,7 +649,7 @@ class ErrorUtils : public AllStatic {
class MessageTemplate {
public:
enum Template {
enum Template : unsigned {
#define TEMPLATE(NAME, STRING) k##NAME,
MESSAGE_TEMPLATES(TEMPLATE)
#undef TEMPLATE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment