* template8.C, typeof1.C: New test.
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Tue, 20 Jul 1999 12:24:37 +0000 (12:24 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Tue, 20 Jul 1999 12:24:37 +0000 (12:24 +0000)
From-SVN: r28189

gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
gcc/testsuite/g++.old-deja/g++.oliva/template8.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.oliva/typeof1.C [new file with mode: 0644]

index 212d672ca04a98b5d79cfb1ad2b9d875cced1908..d049daed22b4ee3f31e6e5bd0f4ae24e4c9aec31 100644 (file)
@@ -1,3 +1,7 @@
+1999-07-20  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * template8.C, typeof1.C: New test.
+
 1999-07-17  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * template6.C, delete1.C, template7.C: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/template8.C b/gcc/testsuite/g++.old-deja/g++.oliva/template8.C
new file mode 100644 (file)
index 0000000..709eeef
--- /dev/null
@@ -0,0 +1,18 @@
+// Build don't link:
+
+// Copyright (C) 1999 Free Software Foundation
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+// simplified from bug report by redleaf <e1wwater@dingo.cc.uq.edu.au>
+
+struct B {
+  template <class> void bar();
+} b;
+
+template <class T> void foo() {
+  b.bar<T>(); // gets bogus error - bar undeclared - XFAIL *-*-*
+  b.template bar<T>(); // gets bogus error - ditto - XFAIL *-*-*
+  b.B::bar<T>(); // ok
+}
+
+template void foo<void>(); // gets bogus error - XFAIL *-*-*
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/typeof1.C b/gcc/testsuite/g++.old-deja/g++.oliva/typeof1.C
new file mode 100644 (file)
index 0000000..628e287
--- /dev/null
@@ -0,0 +1,20 @@
+// Build don't link:
+
+// Copyright (C) 1999 Free Software Foundation
+
+// by Alexandre Oliva <oliva@dcc.unicamp.br>
+
+struct B {
+  int i;
+};
+
+template <class T> void foo(T b) {
+  b.T::i; // ok
+  // b.__typeof__(b)::i; // parse error, should this be accepted?
+  typedef T t1;
+  b.t1::i; // ok
+  typedef __typeof__(b) t2;
+  b.t2::i; // crash test - XFAIL *-*-*
+}
+
+template void foo(B); // not needed for the crash