]> gcc.gnu.org Git - gcc.git/commitdiff
friend34.C: New test...
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Sat, 3 Oct 1998 02:51:23 +0000 (02:51 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Sat, 3 Oct 1998 02:51:23 +0000 (02:51 +0000)
* 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

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/badopt1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/decl1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/decl2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/null2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/typename1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/friend34.C [new file with mode: 0644]

index 48e914e2d6bbbaaae78240b79b16c3dae99faea6..eea6d0c466dfd70ce3f539a7626db1984f583a87 100644 (file)
@@ -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 (file)
index 0000000..ea8b684
--- /dev/null
@@ -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 (file)
index 0000000..7a55ce0
--- /dev/null
@@ -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 (file)
index 0000000..e50a7e7
--- /dev/null
@@ -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 (file)
index 0000000..4659655
--- /dev/null
@@ -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 (file)
index 0000000..2921b3d
--- /dev/null
@@ -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 (file)
index 0000000..8ba2c73
--- /dev/null
@@ -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;
This page took 0.074413 seconds and 5 git commands to generate.