[cfe-commits] r97900 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/CodeGenCXX/default-destructor-nested.cpp
Eli Friedman
eli.friedman at gmail.com
Sat Mar 6 21:49:51 PST 2010
Author: efriedma
Date: Sat Mar 6 23:49:51 2010
New Revision: 97900
URL: http://llvm.org/viewvc/llvm-project?rev=97900&view=rev
Log:
Fix for PR6294: we should only delay recording nested dynamic classes if they
are lexically nested. Othewise, we never end up recording semantically nested
classes.
Added:
cfe/trunk/test/CodeGenCXX/default-destructor-nested.cpp
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=97900&r1=97899&r2=97900&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sat Mar 6 23:49:51 2010
@@ -5030,7 +5030,7 @@
// Exit this scope of this tag's definition.
PopDeclContext();
- if (isa<CXXRecordDecl>(Tag) && !Tag->getDeclContext()->isRecord())
+ if (isa<CXXRecordDecl>(Tag) && !Tag->getLexicalDeclContext()->isRecord())
RecordDynamicClassesWithNoKeyFunction(*this, cast<CXXRecordDecl>(Tag),
RBraceLoc);
Added: cfe/trunk/test/CodeGenCXX/default-destructor-nested.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/default-destructor-nested.cpp?rev=97900&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/default-destructor-nested.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/default-destructor-nested.cpp Sat Mar 6 23:49:51 2010
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 %s -emit-llvm-only
+// PR6294
+
+class A {
+ virtual ~A();
+};
+class B {
+ class C;
+};
+class B::C : public A {
+ C();
+};
+B::C::C() {}
More information about the cfe-commits
mailing list