aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2017-10-10 13:09:40 +0000
committerEric Liu <ioeric@google.com>2017-10-10 13:09:40 +0000
commitf01516db8de1b7f7599b3e21f687adc6f2d71df2 (patch)
tree6c262dbcb89ffa76860da0f94690e83658de5fa4 /clang/lib/AST/DeclBase.cpp
parent8cd38554fbd1ff4a3dbece202d10e415aa892eac (diff)
downloadllvm-f01516db8de1b7f7599b3e21f687adc6f2d71df2.zip
llvm-f01516db8de1b7f7599b3e21f687adc6f2d71df2.tar.gz
llvm-f01516db8de1b7f7599b3e21f687adc6f2d71df2.tar.bz2
Revert "[Modules TS] Module ownership semantics for redeclarations."
This reverts commit r315251. See the original commit thread for reason. llvm-svn: 315309
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 1e15ee9..42f0ba0 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -315,11 +315,12 @@ bool Decl::isLexicallyWithinFunctionOrMethod() const {
}
bool Decl::isInAnonymousNamespace() const {
- for (const DeclContext *DC = getDeclContext(); DC; DC = DC->getParent()) {
+ const DeclContext *DC = getDeclContext();
+ do {
if (const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(DC))
if (ND->isAnonymousNamespace())
return true;
- }
+ } while ((DC = DC->getParent()));
return false;
}