[Bug c++/11357] New: no conversion of build-in binary operator argument attempted
d dot frey at gmx dot de
gcc-bugzilla@gcc.gnu.org
Sat Jun 28 09:07:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11357
Summary: no conversion of build-in binary operator argument
attempted
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: d dot frey at gmx dot de
CC: gcc-bugs at gcc dot gnu dot org
Consider the following code snippet:
struct A {
template< typename T > operator T() const;
} a;
template<> A::operator float() const
{
return 1.0f;
}
int main()
{
float f = 1.0f * a;
}
The GCC 3.3 says:
t.cc: In function `int main()':
t.cc:12: error: no match for `float * A&' operator
t.cc:12: warning: unused variable `float f'
which is probably incorrect. EDG-based compilers like the code and 5.6/2 and 5/9
suggest that they are right. The GCC seems to be unable to decide which
conversion is appopriate and thus fails to attempt to cast A to float. This is
in the GCC since (at least) 2.95.3.
Regards, Daniel
More information about the Gcc-bugs
mailing list