summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
-rw-r--r--clang/test/CodeGenCXX/default-destructor-nested.cpp13
2 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index ec1939e5ece..935adcf1b65 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5030,7 +5030,7 @@ void Sema::ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagD,
// 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);
diff --git a/clang/test/CodeGenCXX/default-destructor-nested.cpp b/clang/test/CodeGenCXX/default-destructor-nested.cpp
new file mode 100644
index 00000000000..86942743d4e
--- /dev/null
+++ b/clang/test/CodeGenCXX/default-destructor-nested.cpp
@@ -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() {}
OpenPOWER on IntegriCloud