r197186 - [ms-abi] Fixing bitfields sema arror for ms-mode
Warren Hunt
whunt at google.com
Thu Dec 12 15:23:28 PST 2013
Author: whunt
Date: Thu Dec 12 17:23:28 2013
New Revision: 197186
URL: http://llvm.org/viewvc/llvm-project?rev=197186&view=rev
Log:
[ms-abi] Fixing bitfields sema arror for ms-mode
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).
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=197186&r1=197185&r2=197186&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Dec 12 17:23:28 2013
@@ -11309,7 +11309,8 @@ ExprResult Sema::VerifyBitField(SourceLo
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()
More information about the cfe-commits
mailing list