diff options
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index f9c1691e85..953e39f92d 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3152,12 +3152,14 @@ void Sema::ActOnTagFinishDefinition(Scope *S, DeclTy *TagD) { bool Sema::VerifyBitField(SourceLocation FieldLoc, IdentifierInfo *FieldName, QualType FieldTy, const Expr *BitWidth) { // C99 6.7.2.1p4 - verify the field type. - + // C++ 9.6p3: A bit-field shall have integral or enumeration type. if (!FieldTy->isIntegralType()) { // Handle incomplete types with specific error. if (FieldTy->isIncompleteType()) - return Diag(FieldLoc, diag::err_field_incomplete) << FieldTy; - return Diag(FieldLoc, diag::err_not_integral_type_bitfield) << FieldName; + return Diag(FieldLoc, diag::err_field_incomplete) + << FieldTy << BitWidth->getSourceRange(); + return Diag(FieldLoc, diag::err_not_integral_type_bitfield) + << FieldName << BitWidth->getSourceRange(); } llvm::APSInt Value; |