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 | d11617f6e0622bbf843d6f8d60c441f844e46e9a (patch) | |
tree | 72e948ae4fb1506e665029497d96fcf3c64a6e60 /lib/Sema/SemaDecl.cpp | |
parent | 9fa8c4652afd4ee0faa70b563688d56c51c7fc93 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index a3b8b8ec30..786a13f1d3 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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; } |