aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/new3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/new3.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/new3.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/new3.C b/gcc/testsuite/g++.old-deja/g++.jason/new3.C
new file mode 100644
index 00000000000..ede3a00e9dd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/new3.C
@@ -0,0 +1,23 @@
+// PRMS Id: 6037
+// Special g++ Options: -fcheck-new
+
+extern "C" void * malloc (__SIZE_TYPE__);
+
+struct A {
+ int i;
+ A () { i = 2; }
+};
+
+int ena = 0;
+void * operator new (__SIZE_TYPE__ s)
+{
+ if (ena)
+ return 0;
+ return malloc (s);
+}
+
+main ()
+{
+ ena = 1;
+ A* ap = new A;
+}