diff options
author | Eric Liu <ioeric@google.com> | 2017-10-10 13:09:40 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2017-10-10 13:09:40 +0000 |
commit | f01516db8de1b7f7599b3e21f687adc6f2d71df2 (patch) | |
tree | 6c262dbcb89ffa76860da0f94690e83658de5fa4 /clang/lib/AST/DeclBase.cpp | |
parent | 8cd38554fbd1ff4a3dbece202d10e415aa892eac (diff) | |
download | llvm-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.cpp | 5 |
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; } |