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]

New C++ parser test


This adds a new C++ parser test derived from C++/70.

-- Gaby

Index: g++.dg/overload/operator-star-1.C
===================================================================
RCS file: g++.dg/overload/operator-star-1.C
diff -N g++.dg/overload/operator-star-1.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- g++.dg/overload/operator-star-1.C	29 Dec 2002 16:12:01 -0000
***************
*** 0 ****
--- 1,27 ----
+ // Copyright (C) 2002 Free Software Foundation
+ // Origin: C++/70
+ // Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
+ // { dg-do compile }
+ 
+ template <class T>
+   struct S;
+ 
+ template <class T>
+   void operator* (S<T>, S<T>);
+ 
+ template <class T>
+   struct S
+   {
+      friend void operator*<> (S, S); // { }   // okay
+      void operator* (T) { }
+   };
+ 
+ template <class T>
+   void operator* (S<T>, S<T>) { }  
+ 
+ int main()
+ {
+    S<int> s1, s2;
+    s1 * s2;
+    s1 * 2;
+ }


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