summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2016-10-11 15:09:26 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2016-10-11 15:09:26 +0000
commita9903747e88a5763790d9d3184293f43ccaebd37 (patch)
tree7150e3140841977216105dcdb42ad4fb836931d8 /clang/lib/Sema/SemaDecl.cpp
parent66b701409211144dde2dac8477181e98333f8033 (diff)
downloadbcm5719-llvm-a9903747e88a5763790d9d3184293f43ccaebd37.tar.gz
bcm5719-llvm-a9903747e88a5763790d9d3184293f43ccaebd37.zip
r283882 followup. Don't demote ParmVarDecls. This should fix our module builds.
llvm-svn: 283887
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index c9a45b2ecc5..cf6f0c818b0 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9709,20 +9709,22 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init,
// The previous definition is hidden, and multiple definitions are
// permitted (in separate TUs). Form another definition of it.
- // Demote the newly parsed definition to a fake declaration.
- if (!VDecl->isThisDeclarationADemotedDefinition())
- VDecl->demoteThisDefinitionToDeclaration();
-
- // Make the definition visible from the point of the demotion on.
- assert (!Hidden || Def == Hidden &&
- "We were suggested another hidden definition!");
- makeMergedDefinitionVisible(Def, VDecl->getLocation());
-
- // If this is a variable template definition, make its enclosing template
- // visible.
- if (VarDecl *VarPattern = Def->getTemplateInstantiationPattern())
- if (VarPattern->isThisDeclarationADefinition())
- makeMergedDefinitionVisible(VarPattern, VDecl->getLocation());
+ if (!isa<ParmVarDecl>(VDecl)) {
+ // Demote the newly parsed definition to a fake declaration.
+ if (!VDecl->isThisDeclarationADemotedDefinition())
+ VDecl->demoteThisDefinitionToDeclaration();
+
+ // Make the definition visible from the point of the demotion on.
+ assert (!Hidden || Def == Hidden &&
+ "We were suggested another hidden definition!");
+ makeMergedDefinitionVisible(Def, VDecl->getLocation());
+
+ // If this is a variable template definition, make its enclosing template
+ // visible.
+ if (VarDecl *VarPattern = Def->getTemplateInstantiationPattern())
+ if (VarPattern->isThisDeclarationADefinition())
+ makeMergedDefinitionVisible(VarPattern, VDecl->getLocation());
+ }
} else {
Diag(VDecl->getLocation(), diag::err_redefinition)
<< VDecl->getDeclName();
OpenPOWER on IntegriCloud