------- Comment #1 from andrew dot stubbs at st dot com 2007-05-18 14:54
-------
EDG version 3.8 gives the warning:
t.cpp", line 15: warning:
ambiguous class member reference -- type "T" (declared at line 14)
used in preference to type "C::T" (declared at line 6)
printf ("%d\n", (T) c.operator T()); // invalid
^
In contrast to GCC, this gives the output "2 2 2", not "1 2 2".
And in -strict mode (full standard conformance) gives the error:
t.cpp", line 15: error:
ambiguous class member reference -- type "T" (declared at line 14)
used in preference to type "C::T" (declared at line 6)
printf ("%d\n", (T) c.operator T()); // invalid
^
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31986