
17 Feb
2005
17 Feb
'05
6 p.m.
Jonathan Wakely wrote:
On Thu, Feb 17, 2005 at 12:48:35AM -0500, Jason Hise wrote:
I would have expected this code not to compile at all, because the == overload seems ambiguous. Is this result standards conforming? If not, what would the standards conforming result be? Does this fall into the realm of undefined behavior?
No, you're first expectation was right - it's ambiguous, so it's an error.
Comeau's online compiler rejects it, as does every version of GCC I can lay my hands on. Seems like a VC++ bug.
VC7.1 is resolving the ambiguity based on the order of the base classes, since reversing them produces a different result. VC8.0 beta does the same, so it should be reported, if it hasn't already been.
jon
Jonathan