aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/operators27.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/operators27.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/operators27.C33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators27.C b/gcc/testsuite/g++.old-deja/g++.law/operators27.C
new file mode 100644
index 00000000000..f8ca9d17317
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.law/operators27.C
@@ -0,0 +1,33 @@
+// GROUPS passed operators
+// opr-new file
+// From: David Binderman 3841 <dcb@us-es.sel.de>
+// Date: Mon, 21 Jun 93 11:42:11 +0200
+// Subject: G++ 2.4.3 and operator new
+// Message-ID: <9306210942.AA10276@slsvitt.us-es.sel.de>
+
+int FLAG=0;
+
+#include <new>
+
+extern "C" int printf( const char *, ...);
+
+void * operator new(size_t, const nothrow_t&) throw() { FLAG=1; return 0; }
+
+class K {
+private:
+ int i;
+public:
+ K( int j) {
+ i = j;
+ }
+};
+
+int main(void)
+{
+ K * pK = new (nothrow) K( 10);
+ if ( FLAG != 1 )
+ printf ("FAIL\n");
+ else
+ printf ("PASS\n");
+ return 0;
+}