projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb13fff
)
Fix r165005: The lexical DeclContext is not the right place to make a decision about...
author
Axel Naumann
<Axel.Naumann@cern.ch>
Thu, 4 Oct 2012 07:34:43 +0000
(07:34 +0000)
committer
Axel Naumann
<Axel.Naumann@cern.ch>
Thu, 4 Oct 2012 07:34:43 +0000
(07:34 +0000)
llvm-svn: 165215
clang/lib/Serialization/ASTReaderDecl.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Serialization/ASTReaderDecl.cpp
b/clang/lib/Serialization/ASTReaderDecl.cpp
index
d9243f6
..
762ad01
100644
(file)
--- a/
clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/
clang/lib/Serialization/ASTReaderDecl.cpp
@@
-1781,11
+1781,13
@@
ASTDeclReader::FindExistingResult::~FindExistingResult() {
if (!AddResult || Existing)
return;
- DeclContext *DC = New->getLexicalDeclContext();
-
if (DC->isTranslationUnit()
&& Reader.SemaObj) {
+ if (New->getDeclContext()->getRedeclContext()->isTranslationUnit()
+
&& Reader.SemaObj) {
Reader.SemaObj->IdResolver.tryAddTopLevelDecl(New, New->getDeclName());
- } else if (DC->isNamespace()) {
- DC->addDecl(New);
+ } else {
+ DeclContext *DC = New->getLexicalDeclContext();
+ if (DC->isNamespace())
+ DC->addDecl(New);
}
}