c++.beta - Error: ambiguous reference to symbol
- steve (12/12) Jan 22 2003 The following code (line 7 and 8) causes the Error: ambiguous reference ...
- Richard Grant (20/25) Jan 23 2003 Here's a more isolated case:
The following code (line 7 and 8) causes the Error: ambiguous reference to symbol #include <iostream> int main() { enum { zero, one, two, three }; std::cout << zero << " "; std::cout << one << "\n"; return 0; } Low priority. Steve
Jan 22 2003
#include <iostream> int main() { enum { zero, one, two, three }; std::cout << zero << " ";Here's a more isolated case: void fn(bool i) { } void fn(unsigned char i) { } void fn(void (*f)()) { } int main() { enum { zero, one, two, three }; fn(zero); // Error: ambiguous reference to symbol // Had: fn(bool ) // and: fn(void (*C func)()) fn(one); // Error: ambiguous reference to symbol // Had: fn(bool ) // and: fn(unsigned char ) return 0; } both are fairly bizzarre. Clearly a problem with automatic type conversion. My guess is that it is suppossed to be the underlying type that is used for conversion. This should be an integer according to 7.2-5. sizeof "zero" is 4. Richard
Jan 23 2003