diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-01-09 18:51:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-01-09 18:51:29 +0000 |
commit | a8cc8ce044e5d2589128f0c1a84e586cce743b27 (patch) | |
tree | 4adb92ceade9162327c38ca3335c964676b8357f /lib/AST/Decl.cpp | |
parent | 1b95a6546d1f3847da29da0d1e8dc5d77b1a7fbb (diff) |
Make sure that ScopedDecls passed to DeclContext::addDecl are added into their lexical context
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 8521b9b44e..f29417ed13 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -164,6 +164,13 @@ FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, // ScopedDecl Implementation //===----------------------------------------------------------------------===// +void ScopedDecl::setDeclContext(DeclContext *DC) { + if (isOutOfSemaDC()) + delete getMultipleDC(); + + DeclCtx = reinterpret_cast<uintptr_t>(DC); +} + void ScopedDecl::setLexicalDeclContext(DeclContext *DC) { if (DC == getLexicalDeclContext()) return; |