[Bug c++/11342] Method selection warning prevents compilation

dan at photon dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 27 01:36:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11342



------- Additional Comments From dan at photon dot com  2003-06-27 01:36 -------
The warning can be circumvented by explicitly calling the [] operator:

char c = s.operator[](0);

Which leads me to believe that gcc did not choose the char& Foo::operator[] like
it claimed, but instead chose the const char* cast operator, for why else would
it compile when the const char* cast operator is not present?



More information about the Gcc-bugs mailing list