summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-01 16:10:38 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-01 16:10:38 +0000
commit1a099ba4db7021e8851ebbe0ad360118a7e0c27e (patch)
treed174cdc07133e8921704e732d8d7a94cb8a6e2be /clang/lib
parentec0e36616333f332534d6759a07dabf596c04b70 (diff)
downloadbcm5719-llvm-1a099ba4db7021e8851ebbe0ad360118a7e0c27e.tar.gz
bcm5719-llvm-1a099ba4db7021e8851ebbe0ad360118a7e0c27e.zip
Improve the diagnostic when the fixed underlying type of a
redeclaration of an enum type differs from that of the original declaration, from Daniel Wallin llvm-svn: 120577
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index a3b8b8ec30f..786a13f1d34 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5961,7 +5961,10 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
T = QualType(EnumUnderlying.get<const Type*>(), 0);
if (!Context.hasSameUnqualifiedType(T, PrevEnum->getIntegerType())) {
- Diag(KWLoc, diag::err_enum_redeclare_type_mismatch);
+ Diag(NameLoc.isValid() ? NameLoc : KWLoc,
+ diag::err_enum_redeclare_type_mismatch)
+ << T
+ << PrevEnum->getIntegerType();
Diag(PrevTagDecl->getLocation(), diag::note_previous_use);
return PrevTagDecl;
}
OpenPOWER on IntegriCloud