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]

[C++ testsuite] new testcase for PR c++/8702


Hi,

I was wondering if the following new testcase is OK for submission?

Compiling with:
gcc version 3.3 20021120

results in:
typename5.C:19: error: no `C2<X>::operator C1<Y>()' member function declared in
   class `C2<X>'
typename5.C:19: error: template definition of non-template `C2<X>::operator
   C1<Y>()'


which is a regression from gcc 3.2.



2002-11-26  Craig Rodrigues  <rodrigc@gcc.gnu.org>

        PR c++/8702
        * g++.dg/template/typename5.C: New test. GCC 3.3 regression.



--- /dev/null   Thu Feb 21 14:26:01 2002
+++ testsuite/g++.dg/template/typename5.C       Tue Nov 26 15:51:19 2002
@@ -0,0 +1,22 @@
+// { dg-do compile }
+//
+// Contributed by Wolfgang Bangerth <bangerth@gcc.gnu.org> and
+//  Craig Rodrigues <rodrigc@gcc.gnu.org>
+//
+// PR c++/8702 [3.3 regression] matching of conversion operators
+
+template <typename X> struct C1{};
+
+template <typename X>
+struct C2 {
+ template<typename Y> operator C1<Y>();
+ template<typename Y> operator C2<Y>();
+};
+
+
+template<typename X> template<typename Y>
+C2<X>::operator C1<Y>()
+{
+  return C1<Y>();
+}
+



-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@attbi.com


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