aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@dcc.unicamp.br>1998-10-03 02:51:23 +0000
committerAlexandre Oliva <oliva@gcc.gnu.org>1998-10-03 02:51:23 +0000
commit5e95b7c76d58d77028b0cf5fd016da5a05d4bd66 (patch)
treedfd600556905916f6138e0313dbba8f62939ab8b /gcc
parentc30cc19e56bb5b482ce7bddefe90bd6512ad17a7 (diff)
downloadgcc-5e95b7c76d58d77028b0cf5fd016da5a05d4bd66.zip
gcc-5e95b7c76d58d77028b0cf5fd016da5a05d4bd66.tar.gz
gcc-5e95b7c76d58d77028b0cf5fd016da5a05d4bd66.tar.bz2
friend34.C: New test...
* g++.old-deja/g++.pt/friend34.C: New test; name injection of friend template declared within template class conflicts with nested class of the same name * g++.old-deja/g++.other/badopt1.C: New test; post-increment is ignored * g++.old-deja/g++.other/decl1.C: New test; incorrect parsing of object with direct initializer as function declaration * g++.old-deja/g++.other/decl2.C: New test; duplicate initializers * g++.old-deja/g++.other/null2.C: New test; conditional operator involving const pointer and NULL produces incorrect result * g++.old-deja/g++.other/typename1.C: New test; template-dependent type name without `typename' should be rejected with -pedantic From-SVN: r22770
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/badopt1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl1.C10
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/decl2.C7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/null2.C14
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typename1.C17
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend34.C15
7 files changed, 100 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 48e914e..eea6d0c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,23 @@
+1998-10-03 Alexandre Oliva <oliva@dcc.unicamp.br>
+
+ * g++.old-deja/g++.pt/friend34.C: New test; name injection of
+ friend template declared within template class conflicts with
+ nested class of the same name
+
+ * g++.old-deja/g++.other/badopt1.C: New test; post-increment
+ is ignored
+
+ * g++.old-deja/g++.other/decl1.C: New test; incorrect parsing of
+ object with direct initializer as function declaration
+
+ * g++.old-deja/g++.other/decl2.C: New test; duplicate initializers
+
+ * g++.old-deja/g++.other/null2.C: New test; conditional operator
+ involving const pointer and NULL produces incorrect result
+
+ * g++.old-deja/g++.other/typename1.C: New test; template-dependent
+ type name without `typename' should be rejected with -pedantic
+
Fri Oct 2 21:55:58 1998 Richard Henderson <rth@cygnus.com>
* g++.old-deja/g++.other/addrof1.C: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/badopt1.C b/gcc/testsuite/g++.old-deja/g++.other/badopt1.C
new file mode 100644
index 0000000..ea8b684
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/badopt1.C
@@ -0,0 +1,17 @@
+// Based on a testcase by Bryan Weston <bryanw@bluemoon.sps.mot.com>
+// egcs 1.1 fails to increment count
+
+// execution test - XFAIL *-*-*
+
+#include <cstdlib>
+
+struct Base { Base() {} }; // removing the constructor fixes the problem
+struct Derived : Base {}; // so does removing the base class
+
+int main() {
+ int count = 0;
+ Derived* array[1]; // making this Base*[1] does not fix the problem
+ array[count++] = new Derived (); // but then new Base() does
+ if (count!=1)
+ std::abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl1.C b/gcc/testsuite/g++.old-deja/g++.other/decl1.C
new file mode 100644
index 0000000..7a55ce0
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl1.C
@@ -0,0 +1,10 @@
+// Build don't link:
+// Based on a test case by Phil Blecker <tmwg@inxservices.com>
+
+// excess errors test - XFAIL *-*-*
+
+int foo(int);
+int bar() {
+ int baz(int(foo(0)));
+ int foo = baz;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/decl2.C b/gcc/testsuite/g++.old-deja/g++.other/decl2.C
new file mode 100644
index 0000000..e50a7e7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/decl2.C
@@ -0,0 +1,7 @@
+// Build don't link:
+// Based on a test-case by Maciej Radziejewski <maciejr@iws.uni-stuttgart.de>
+
+int i(0)(1); // ERROR - multiple initialization - XCRASH *-*-*
+int j(2) = 3; // ERROR - multiple initialization
+int k(4)(5)(6); // ERROR - multiple initialization
+int m, n(7)(8); // ERROR - multiple initialization
diff --git a/gcc/testsuite/g++.old-deja/g++.other/null2.C b/gcc/testsuite/g++.old-deja/g++.other/null2.C
new file mode 100644
index 0000000..4659655
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/null2.C
@@ -0,0 +1,14 @@
+// Based on a testcase by Eric Dumazet <Eric.Dumazet@COSMOSBAY.COM>
+
+// execution test - XFAIL *-*-*
+
+#include <cstdlib>
+
+const char * const foo = ""; // foo is not NULL
+
+int main() {
+ if ((foo == 0) ? 0 : foo) // so this should evaluate to `foo'
+ return 0;
+ else
+ std::abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typename1.C b/gcc/testsuite/g++.old-deja/g++.other/typename1.C
new file mode 100644
index 0000000..2921b3d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/typename1.C
@@ -0,0 +1,17 @@
+// This code snippet should be rejected with -pedantic
+// Based on a test case by Louidor Erez <s3824888@techst02.technion.ac.il>
+
+// Build don't link:
+// Special g++ Options: -pedantic
+
+template<class T>
+class Vector {
+public:
+ typedef T* iterator;
+};
+
+template<class T>
+void f()
+{
+ Vector<T>::iterator i = 0; // ERROR - missing typename - XFAIL *-*-*
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend34.C b/gcc/testsuite/g++.old-deja/g++.pt/friend34.C
new file mode 100644
index 0000000..8ba2c73
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend34.C
@@ -0,0 +1,15 @@
+// Build don't link:
+// excess errors test - XFAIL *-*-*
+
+// This testcase won't fail if class ::foo is forward-declared in the
+// global namespace, nor if class bar is not a template class.
+
+template <typename T = void>
+class bar {
+public:
+ friend class foo; // this is not bar::foo, it forward-declares ::foo
+ class foo {};
+ bar() { foo(); } // but this should refer to bar::foo
+};
+
+bar<> baz;