This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ testsuite] new testcase for PR c++/8702
- From: Craig Rodrigues <rodrigc at attbi dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 26 Nov 2002 15:58:47 -0500
- Subject: [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