aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization
diff options
context:
space:
mode:
authorAxel Naumann <Axel.Naumann@cern.ch>2012-10-02 13:06:13 +0000
committerAxel Naumann <Axel.Naumann@cern.ch>2012-10-02 13:06:13 +0000
commitbb2011db250de41f69fdbaaa35ff78310a7499f1 (patch)
tree391bb66408c364db1ff5bc8ce0ce91a43535c21c /lib/Serialization
parent1ecf0e6e271f3046bc53264318c47eae0fb80afd (diff)
Add redecls into their lexical DeclContext: this is what they assert on, and the merging should have set it correctly.
This is especially relevant for templatedDecls that might be injected (and thus have their DeclContext set to) somewhere completely different. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization')
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index e770c06519..4f2da6bc51 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -1775,7 +1775,7 @@ ASTDeclReader::FindExistingResult::~FindExistingResult() {
if (!AddResult || Existing)
return;
- DeclContext *DC = New->getDeclContext()->getRedeclContext();
+ DeclContext *DC = New->getLexicalDeclContext();
if (DC->isTranslationUnit() && Reader.SemaObj) {
if (Reader.SemaObj->IdResolver.tryAddTopLevelDecl(New, New->getDeclName()))
Reader.RedeclsAddedToAST.insert(New);