summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 8af7e5a1d03..cd6ff6ce582 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2223,7 +2223,11 @@ static void checkNewAttributesAfterDef(Sema &S, Decl *New, const Decl *Old) {
S.CheckForFunctionRedefinition(FD, cast<FunctionDecl>(Def));
else {
VarDecl *VD = cast<VarDecl>(New);
- S.Diag(VD->getLocation(), diag::err_redefinition) << VD->getDeclName();
+ unsigned Diag = cast<VarDecl>(Def)->isThisDeclarationADefinition() ==
+ VarDecl::TentativeDefinition
+ ? diag::err_alias_after_tentative
+ : diag::err_redefinition;
+ S.Diag(VD->getLocation(), Diag) << VD->getDeclName();
S.Diag(Def->getLocation(), diag::note_previous_definition);
VD->setInvalidDecl();
}
OpenPOWER on IntegriCloud