summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/delete2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/delete2.C')
-rwxr-xr-xgcc/testsuite/g++.old-deja/g++.other/delete2.C13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/delete2.C b/gcc/testsuite/g++.old-deja/g++.other/delete2.C
new file mode 100755
index 0000000..d90def0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/delete2.C
@@ -0,0 +1,13 @@
+// Build don't link:
+
+struct foo {
+ operator char*() const;
+};
+
+void bar(foo a) {
+ delete a; // should be accepted
+ delete[] a; // should be accepted
+ char b[1];
+ delete b; // ERROR - expecting pointer type
+ delete[] b; // ERROR - expecting pointer type
+}