This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11684] cannot find non-template (builtin) operator*(float,float)
- From: "nickn at newsonnet dot fsnet dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jul 2003 07:13:13 -0000
- Subject: [Bug c++/11684] cannot find non-template (builtin) operator*(float,float)
- References: <20030727150730.11684.nickn@newsonnet.fsnet.co.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11684
------- Additional Comments From nickn at newsonnet dot fsnet dot co dot uk 2003-07-31 07:13 -------
More than likely I don't quite understand the problem properly, but what's
wrong with gcc choosing the template based operator*? In the
expression "aTest * bTest", aTest is a class of type "test" whilst bTest is a
float. The problem, to me at least, is that it chooses the intrinsic type
(float) to represent the untyped variable in the template where as a better
match would be to match the float to the float and the test class to the
unknown type.
In the error (base on the aTest (class test) * bTest (float)):
test.cpp:31: `float operator*(float, typeB) [with typeB = float]' must have
an argument of class or enumerated type
surely it would have be fine if it'd choosen the other operator*(typeA,
float )?
Like I said - more than likely I don't understand the problem properly! :)