Some more C++ testcases
Jakub Jelinek
jakub@redhat.com
Fri Nov 3 07:28:00 GMT 2000
Hi!
Another set of failing C++ testcases. crash30-32 are for invalid input, 33
and 34 are on valid input.
Ok to commit them? Any ideas on what better names should I use for the
tests?
2000-11-03 Jakub Jelinek <jakub@redhat.com>
* g++.old-deja/g++.other/crash30.C: New test.
* g++.old-deja/g++.other/crash31.C: New test.
* g++.old-deja/g++.other/crash32.C: New test.
* g++.old-deja/g++.other/crash33.C: New test.
* g++.old-deja/g++.other/crash34.C: New test.
--- gcc/testsuite/g++.old-deja/g++.other/crash30.C.jj Fri Nov 3 16:28:25 2000
+++ gcc/testsuite/g++.old-deja/g++.other/crash30.C Fri Nov 3 13:33:30 2000
@@ -0,0 +1,16 @@
+// Build don't link:
+
+struct foo
+{
+ foo();
+ void x();
+};
+
+void foo::x() throw(bar) // ERROR - parse error
+{
+}
+
+void bar()
+{
+ foo x;
+}
--- gcc/testsuite/g++.old-deja/g++.other/crash31.C.jj Fri Nov 3 16:28:25 2000
+++ gcc/testsuite/g++.old-deja/g++.other/crash31.C Fri Nov 3 13:46:02 2000
@@ -0,0 +1,8 @@
+// Build don't link:
+
+namespace bar
+{
+struct foo
+{
+ foo();
+}; // ERROR - parse error
--- gcc/testsuite/g++.old-deja/g++.other/crash32.C.jj Fri Nov 3 16:28:25 2000
+++ gcc/testsuite/g++.old-deja/g++.other/crash32.C Fri Nov 3 14:36:58 2000
@@ -0,0 +1,29 @@
+// Build don't link:
+
+struct foo
+{
+ enum e
+ {
+ not // ERROR -
+ };
+ ~foo();
+ void x (foo *&a, bool b = (unsigned char)0);
+};
+
+namespace N
+{
+ struct bar;
+
+ template<class T>
+ struct baz
+ {
+ baz(T *p);
+ };
+
+ typedef baz<bar> c;
+}
+
+struct z
+{
+ int a;
+};
--- gcc/testsuite/g++.old-deja/g++.other/crash33.C.jj Fri Nov 3 16:28:25 2000
+++ gcc/testsuite/g++.old-deja/g++.other/crash33.C Fri Nov 3 14:52:06 2000
@@ -0,0 +1,12 @@
+// Build don't link:
+
+template <class T>
+inline const T& bar(const T& a, const T& b)
+{
+ return a < b ? b : a;
+}
+
+int foo(void)
+{
+ return bar(sizeof(int), sizeof(long));
+}
--- gcc/testsuite/g++.old-deja/g++.other/crash34.C.jj Fri Nov 3 16:28:25 2000
+++ gcc/testsuite/g++.old-deja/g++.other/crash34.C Fri Nov 3 15:50:27 2000
@@ -0,0 +1,21 @@
+// Build don't link:
+
+class v
+{
+ double x, y;
+public:
+ v();
+};
+
+class w : public v {
+public :
+ static const w X;
+ w();
+};
+
+void bar(w x);
+
+void foo()
+{
+ bar(w::X);
+}
Jakub
More information about the Gcc-patches
mailing list