aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-13 23:49:34 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-13 23:49:34 +0000
commit91534a357695fbdf3c136fb04218e37706da73a9 (patch)
treef3e2d6568d8c25a09ebba7f721ace62ebc2285f9 /lib/Serialization/ASTReaderDecl.cpp
parentdd9d64547831728dd792654bb26477f5099a2153 (diff)
(Implicit) parameters deserialized as part of a function type must not
get added to the identifier chains as part of deserialization, because they should not be visible to name lookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index 6b8a72f807..75c079fb65 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -879,8 +879,10 @@ void ASTDeclReader::VisitVarDecl(VarDecl *VD) {
VD->VarDeclBits.NRVOVariable = Record[Idx++];
VD->VarDeclBits.CXXForRangeDecl = Record[Idx++];
VD->VarDeclBits.ARCPseudoStrong = Record[Idx++];
-
- mergeRedeclarable(VD, Redecl);
+
+ // Only true variables (not parameters or implicit parameters) can be merged.
+ if (VD->getKind() == Decl::Var)
+ mergeRedeclarable(VD, Redecl);
if (uint64_t Val = Record[Idx++]) {
VD->setInit(Reader.ReadExpr(F));