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]

Add testcase for C++/1058


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;
+ }


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