summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
authorFaisal Vali <faisalv@yahoo.com>2018-01-01 16:36:47 +0000
committerFaisal Vali <faisalv@yahoo.com>2018-01-01 16:36:47 +0000
commit5ffbeb4057b48ae3564e50e0a970264cc86c8f5c (patch)
tree8fe9ed55830bf979937f96df9a2d884bdfe6c17c /clang/lib/Sema/DeclSpec.cpp
parent18962dabb74863b17f4607a27717d2aabb375614 (diff)
downloadbcm5719-llvm-5ffbeb4057b48ae3564e50e0a970264cc86c8f5c.tar.gz
bcm5719-llvm-5ffbeb4057b48ae3564e50e0a970264cc86c8f5c.zip
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. llvm-svn: 321625
Diffstat (limited to 'clang/lib/Sema/DeclSpec.cpp')
-rw-r--r--clang/lib/Sema/DeclSpec.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 69266933d6d..c76d94e7d80 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud