diff options
author | Faisal Vali <faisalv@yahoo.com> | 2018-01-01 16:36:47 +0000 |
---|---|---|
committer | Faisal Vali <faisalv@yahoo.com> | 2018-01-01 16:36:47 +0000 |
commit | 6450af4a6a158ad37db5d7b5c1b982380d0dd54b (patch) | |
tree | 87704cb98e303b371a97bf852798daade3bcd68d /lib | |
parent | 39c04dc5ca408fb5debee38c4695dfa02da74ee8 (diff) |
Use 'unsigned int' instead of enum bit-fields to silence some warnings from r321622
- bots were complaining that the bit-field width was less than the width of the underlying type (note, underlying types of enums can not be bit-fields)
- add static_asserts for TSS and TSW to ensure that the bit-fields can hold all the enumerators - and add comments next to the last enumerator warning not to reorder.
See https://reviews.llvm.org/rC321622 for the patch that introduced the warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/DeclSpec.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp index 69266933d6..c76d94e7d8 100644 --- a/lib/Sema/DeclSpec.cpp +++ b/lib/Sema/DeclSpec.cpp @@ -972,9 +972,9 @@ bool DeclSpec::SetConstexprSpec(SourceLocation Loc, const char *&PrevSpec, } void DeclSpec::SaveWrittenBuiltinSpecs() { - writtenBS.Sign = getTypeSpecSign(); - writtenBS.Width = getTypeSpecWidth(); - writtenBS.Type = getTypeSpecType(); + writtenBS.Sign = static_cast<unsigned char>(getTypeSpecSign()); + writtenBS.Width = static_cast<unsigned char>(getTypeSpecWidth()); + writtenBS.Type = static_cast<unsigned char>(getTypeSpecType()); // Search the list of attributes for the presence of a mode attribute. writtenBS.ModeAttr = false; AttributeList* attrs = getAttributes().getList(); |