c++/3979: An update to problem #3971
Dennis Kennedy
kennedy@roguewave.com
Fri Aug 10 08:47:00 GMT 2001
Why does the conversion from A<T> to B<T> fail?? In class B there is the
conversion operator:
B(const A<T> &X ) : A<T>(X) {;}
Thanks,
Dennis
-----Original Message-----
From: lerdsuwa@gcc.gnu.org [ mailto:lerdsuwa@gcc.gnu.org ]
Sent: Friday, August 10, 2001 7:20 AM
To: gcc-bugs@gcc.gnu.org; gcc-prs@gcc.gnu.org; kennedy@roguewave.com;
nobody@gcc.gnu.org
Subject: Re: c++/3979: An update to problem #3971
Synopsis: An update to problem #3971
State-Changed-From-To: open->closed
State-Changed-By: lerdsuwa
State-Changed-When: Fri Aug 10 07:20:00 2001
State-Changed-Why:
Not a bug. The only possible match (using template
argument deduction rule) is:
template< class T>
inline A<T> operator *(const A<T> &a, const A<T> &b);
and the conversion from B<T> to A<T> fails. The function
template< class T>
inline B<T> operator *(const B<T> &a, const B<T> &b);
is not considered (See section 14.8.2.1 para 3 in the
standard).
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3979&database=gcc
More information about the Gcc-bugs
mailing list