In porting my code from g++-2.95.1 to kcc I noticed the following.
----------------------
struct A {
static int Unipolar (int x) {
return (x == 1) ? 0 : 1;
}
template<class X>
int B (X x) {
return Unipolar(x);
}
};
inline int Unipolar (int x) {
return (x == 1) ? 0 : 1;
}
main() {
A a;
int y = a.B (0);
}
---------------------------
gcc-2.95.1 accepts this without complaint. But KCC-3.4 says:
"../bug2.cc", line 7: error: more than one instance of overloaded function
"Unipolar" matches the argument list:
function "Unipolar(int)"
function "A::Unipolar(int)"
argument types are: (int)
return Unipolar(x);
^
detected during instantiation of "int A::B(X) [with X=int]" at line
17
------------------------------
Which is correct?