aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/kext4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/kext4.C')
-rw-r--r--gcc/testsuite/g++.dg/kext4.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/kext4.C b/gcc/testsuite/g++.dg/kext4.C
new file mode 100644
index 00000000000..bdaefb61121
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext4.C
@@ -0,0 +1,27 @@
+/* APPLE LOCAL file KEXT double destructor */
+/* { dg-do compile } */
+/* { dg-options "-fapple-kext" } */
+/* test for use of apple_kext_compatibility on stack */
+struct B1 {
+ virtual ~B1();
+} __attribute__((apple_kext_compatibility));
+
+struct D1 : B1 {
+ void operator delete(void *) { }
+ D1();
+};
+
+struct D2 : B1 {
+ void operator delete(void *);
+ D2();
+};
+
+struct D3 : B1 {
+ D3();
+};
+
+void foo() {
+ D1 d1; // ok
+ D2 d2; // { dg-warning "is an instance of a class" }
+ D3 d3; // { dg-warning "is an instance of a class" }
+}