summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/destructor-crash.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2015-06-21 16:33:50 +0000
committerDavide Italiano <davide@freebsd.org>2015-06-21 16:33:50 +0000
commit8c93d5eddc7524d17767b5546155d5be95c3696d (patch)
tree61ccdefbda654785b87e8328796b67509e23e293 /clang/test/CodeGenCXX/destructor-crash.cpp
parentfd704fe8956828c668a74bd798ad9c8042c592c2 (diff)
downloadbcm5719-llvm-8c93d5eddc7524d17767b5546155d5be95c3696d.tar.gz
bcm5719-llvm-8c93d5eddc7524d17767b5546155d5be95c3696d.zip
[Codegen] Don't crash if destructor is not accessible.
Testcase provided, in the PR, by Christian Shelton and reduced by David Majnemer. PR: 23584 Differential Revision: http://reviews.llvm.org/D10508 Reviewed by: rnk llvm-svn: 240242
Diffstat (limited to 'clang/test/CodeGenCXX/destructor-crash.cpp')
-rw-r--r--clang/test/CodeGenCXX/destructor-crash.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/destructor-crash.cpp b/clang/test/CodeGenCXX/destructor-crash.cpp
new file mode 100644
index 00000000000..43291986514
--- /dev/null
+++ b/clang/test/CodeGenCXX/destructor-crash.cpp
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 %s -emit-llvm -std=c++11 -o %t
+
+struct A {
+ ~A();
+};
+
+struct B {
+ A a;
+};
+
+struct C {
+ union {
+ B b;
+ };
+
+ ~C() noexcept;
+};
+
+C::~C() noexcept {}
OpenPOWER on IntegriCloud