[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).

llvm-svn: 197186
This commit is contained in:
Warren Hunt 2013-12-12 23:23:28 +00:00
parent f04fd0b330
commit 96afec1def

View 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()