This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Testcases for the new parser.


The following patch adds a few testcases for PRs that were closed recently.
Tested on i686-pc-linux-gnu.
Applied to mainline.


2003-02-04  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>

	PR c++/38
	* g++.dg/parse/array-size1.C: New test.

	PR c++/5657
	* g++.dg/parse/undefined3.C: New test.

	PR c++/5665
	* g++.dg/parse/undefined4.C: New test.

	PR c++/5975
	* g++.dg/parse/undefined5.C: New test.

	PR c++/7259
	* g++.dg/parse/tmpl-tmpl-param1.C: New test.

	PR c++/8578
	* g++.dg/parse/casting-operator1.C: New test.

	PR c++/8596
	* g++.dg/parse/undefined6.C: New test.

	PR c++/8736
	* g++.dg/parse/missing-template1.C: New test.

===============================================================================
diff -Nup /dev/null g++.dg/parse/array-size1.C
--- /dev/null	Tue Feb  4 15:57:01 2003
+++ g++.dg/parse/array-size1.C	Tue Feb  4 23:38:19 2003
@@ -0,0 +1,13 @@
+// PR c++/38
+// Origin: Wolfgang Bangerth <bangerth@dealii.org>
+// { dg-do compile }
+
+template <int i> struct A
+{
+    static const int n = 1;
+    typedef double X[n];
+
+    A (const X&);
+};
+
+template <int i> A<i>::A (const X&) {}
===============================================================================
diff -Nup /dev/null g++.dg/parse/undefined3.C
--- /dev/null	Tue Feb  4 15:57:01 2003
+++ g++.dg/parse/undefined3.C	Tue Feb  4 23:42:38 2003
@@ -0,0 +1,6 @@
+// PR c++/5657
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// { dg-do compile }
+
+template<typename T> struct A { A(B); };
+template<typename T> A<T>::A(B) {} // { dg-error "" }
===============================================================================
diff -Nup /dev/null g++.dg/parse/undefined4.C
--- /dev/null	Tue Feb  4 15:57:01 2003
+++ g++.dg/parse/undefined4.C	Tue Feb  4 23:36:50 2003
@@ -0,0 +1,11 @@
+// PR c++/5665
+// Origin: Bergur Ragnarsson <bergur@tern.is>
+// Reduced version: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// { dg-do compile }
+
+template<typename T> class A
+{
+    class B { X foo(); }; // { dg-error "" }
+};
+
+template<typename T> X A<T>::B::foo() {} // { dg-error "" }
===============================================================================
diff -Nup /dev/null g++.dg/parse/undefined5.C
--- /dev/null	Tue Feb  4 15:57:01 2003
+++ g++.dg/parse/undefined5.C	Tue Feb  4 23:36:18 2003
@@ -0,0 +1,5 @@
+// PR c++/5975
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// { dg-do compile }
+
+typedef typename X::Y<> y;  // { dg-error "" }
===============================================================================
diff -Nup /dev/null g++.dg/parse/tmpl-tmpl-param1.C
--- /dev/null	Tue Feb  4 15:57:01 2003
+++ g++.dg/parse/tmpl-tmpl-param1.C	Tue Feb  4 23:46:16 2003
@@ -0,0 +1,14 @@
+// PR c++/7259
+// Origin: Philipp Buettgenbach <P.Buettgenbach@FH-Wolfenbuettel.DE>
+// Reduced version: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+// { dg-do compile }
+
+template <template <int> class T> class A : public T<0> {};
+
+template <typename> struct B
+{
+    template <int> class C {};
+    typedef A<C> D;
+};
+
+B<void>::D d;
===============================================================================
diff -Nup /dev/null g++.dg/parse/casting-operator1.C
--- /dev/null	Tue Feb  4 15:57:01 2003
+++ g++.dg/parse/casting-operator1.C	Tue Feb  4 23:35:47 2003
@@ -0,0 +1,11 @@
+// PR c++/8578
+// Origin: <Delana.Lorenzo@libero.it>
+// { dg-do compile }
+
+template <typename T> struct A
+{
+    typedef typename T::X X;
+    operator X();
+};
+
+template <typename T> A<T>::operator typename A<T>::X () {}
===============================================================================
diff -Nup /dev/null g++.dg/parse/undefined6.C
--- /dev/null	Tue Feb  4 15:57:01 2003
+++ g++.dg/parse/undefined6.C	Tue Feb  4 23:53:44 2003
@@ -0,0 +1,6 @@
+// PR c++/8596
+// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+// { dg-do compile }
+
+template <int i> struct A {};
+template <int i> struct B : A<x>{}; // { dg-error "" }
===============================================================================
diff -Nup /dev/null g++.dg/parse/missing-template1.C
--- /dev/null	Tue Feb  4 15:57:01 2003
+++ g++.dg/parse/missing-template1.C	Tue Feb  4 23:55:00 2003
@@ -0,0 +1,21 @@
+// PR c++/8736
+// Origin: Peter Kolloch <pkolloch@gmx.ne>
+// { dg-do compile }
+
+template <typename T> struct A
+{
+    template <typename U> struct B
+    {
+        typedef int X;
+    };
+};
+
+template <typename T> void foo()
+{
+    typedef typename A<T>::B<T>::X Y; // { dg-error "" }
+}
+
+void bar()
+{
+    foo<int>();
+}
===============================================================================



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]