This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/31986] conversion-type-id should match in both contexts



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]