aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-05 23:01:03 +0000
committerChris Lattner <sabre@nondot.org>2009-03-05 23:01:03 +0000
commit8b963ef99be6235f1e9fe866180fff7dbbe5e85b (patch)
tree740bb5d5fe8df8e31be4f501907bab19adda069e /lib/Sema/SemaDecl.cpp
parentfe345572459b69a6b680322fef504b4f8bd98dd7 (diff)
refactor C++ bitfield checking a bit (haha)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp8
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;