]> granicus.if.org Git - clang/commitdiff
[ms-abi] Fixing bitfields sema arror for ms-mode
authorWarren Hunt <whunt@google.com>
Thu, 12 Dec 2013 23:23:28 +0000 (23:23 +0000)
committerWarren Hunt <whunt@google.com>
Thu, 12 Dec 2013 23:23:28 +0000 (23:23 +0000)
The check for bitfields that are longer than their base type needed to
be checked in microsoft mode (cl.exe does not support the C++ extnetion
for bitfields longer than their type).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197186 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index aa2104e0aac476b816dcb6f263b10801659d6544..6eb8955dbcabc719daa54fb65f47553eb095aa56 100644 (file)
@@ -11309,7 +11309,8 @@ ExprResult Sema::VerifyBitField(SourceLocation FieldLoc,
   if (!FieldTy->isDependentType()) {
     uint64_t TypeSize = Context.getTypeSize(FieldTy);
     if (Value.getZExtValue() > TypeSize) {
-      if (!getLangOpts().CPlusPlus || IsMsStruct) {
+      if (!getLangOpts().CPlusPlus || IsMsStruct ||
+          Context.getTargetInfo().getCXXABI().isMicrosoft()) {
         if (FieldName) 
           return Diag(FieldLoc, diag::err_bitfield_width_exceeds_type_size)
             << FieldName << (unsigned)Value.getZExtValue()