This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31986] conversion-type-id should match in both contexts
- From: "andrew dot stubbs at st dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 May 2007 13:54:16 -0000
- Subject: [Bug c++/31986] conversion-type-id should match in both contexts
- References: <bug-31986-10252@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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