diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-12-01 16:10:38 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-12-01 16:10:38 +0000 |
| commit | 1a099ba4db7021e8851ebbe0ad360118a7e0c27e (patch) | |
| tree | d174cdc07133e8921704e732d8d7a94cb8a6e2be /clang/lib | |
| parent | ec0e36616333f332534d6759a07dabf596c04b70 (diff) | |
| download | bcm5719-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.cpp | 5 |
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; } |

