This is the mail archive of the gcc-bugs@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]

[Bug c++/11684] cannot find non-template (builtin) operator*(float,float)


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!  :)


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