aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp5
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;
}