aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/operators28.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.law/operators28.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/operators28.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators28.C b/gcc/testsuite/g++.old-deja/g++.law/operators28.C
new file mode 100644
index 00000000000..c0d1ecdad2d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.law/operators28.C
@@ -0,0 +1,30 @@
+// Build don't link:
+// GROUPS passed operators
+#include <sys/types.h>
+#include <stdio.h>
+
+class new_test
+{
+ int type;
+public:
+ void* operator new(size_t sz, int count, int type);
+};
+
+void* new_test::operator new(size_t sz, int count, int type)
+{
+ void *p;
+
+ printf("%d %d %d\n", sz, count, type);
+
+ p = new char[sz * count];
+ ((new_test *)p)->type = type;
+ return p;
+};
+
+main()
+{
+ new_test *test;
+ int count = 13;
+
+ test = new(count, 1) new_test;
+};