This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Add testcase for C++/1058
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: 29 Dec 2002 17:43:41 +0100
- Subject: Add testcase for C++/1058
- Organization: Integrable Solutions
This adds a testcase for C++1058, which is fixed with the new parser
merge.
-- Gaby
Index: template-id-1.C
===================================================================
RCS file: template-id-1.C
diff -N template-id-1.C
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- template-id-1.C 29 Dec 2002 16:32:06 -0000
***************
*** 0 ****
--- 1,33 ----
+ // Copyright (C) 2002 Free Software Foundation
+ // Origin: C++/1058
+ // Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
+ // { dg-do compile }
+
+ struct A {
+ typedef int Y;
+ typedef double Z;
+ };
+
+ struct B {
+ template<typename T>
+ void func(typename T::Y, typename T::Z) { }
+ };
+
+ template<typename T>
+ struct X {
+ void gunc();
+ };
+
+ template<typename T>
+ void X<T>::gunc()
+ {
+ B b;
+ b.func<A>(0, 3.);
+ }
+
+ int main()
+ {
+ X<int> x;
+ x.gunc();
+ return 0;
+ }