diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-03-24 00:46:35 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-03-24 00:46:35 +0000 |
| commit | f9f54eab439ef3141a22886e8d30d1f799c4dd22 (patch) | |
| tree | d6ba3556a1136ed9f705a1bef00154c8ff00f75c /clang/lib | |
| parent | 68fdb871dc1cbc662987d204de823f24f0b3f837 (diff) | |
| download | bcm5719-llvm-f9f54eab439ef3141a22886e8d30d1f799c4dd22.tar.gz bcm5719-llvm-f9f54eab439ef3141a22886e8d30d1f799c4dd22.zip | |
Make sure to properly track the anonymous namespace that lives inside
each namespace, even when the outer namespace has multiple
definitions. As part of this, collapsed two pointers worth of storage
(original namespace and inner anonymous namespace) into a single
pointer with a distinguishing bit, since the two are mutually
exclusive, saving a pointer per NamespaceDecl. Fixes PR6620.
llvm-svn: 99368
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 3e97b6bf71a..76875c97739 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -2955,7 +2955,6 @@ Sema::DeclPtrTy Sema::ActOnStartNamespaceDef(Scope *NamespcScope, } else { // Anonymous namespaces. assert(Namespc->isAnonymousNamespace()); - CurContext->addDecl(Namespc); // Link the anonymous namespace into its parent. NamespaceDecl *PrevDecl; @@ -2977,6 +2976,8 @@ Sema::DeclPtrTy Sema::ActOnStartNamespaceDef(Scope *NamespcScope, PrevDecl->setNextNamespace(Namespc); } + CurContext->addDecl(Namespc); + // C++ [namespace.unnamed]p1. An unnamed-namespace-definition // behaves as if it were replaced by // namespace unique { /* empty body */ } |

