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++/11342] New: Method selection warning prevents compilation


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

           Summary: Method selection warning prevents compilation
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dan at photon dot com
                CC: gcc-bugs at gcc dot gnu dot org

In certain cases, I have source code that generates the following warning:

test.cpp In member function 'xxxx':
test.cpp:xx choosing 'char& String::operator[](unsigned int)' over 'operator[] '
test.cpp:xx   because worst conversion for the former is better than worst 
   conversion for the latter

I've gotten a test case pruned down to the class with the offending methods
(char& String::operator[](unsigned int) and char String::operator[](unsigned
int) const). But if I strip out everything in the class except for the methods,
the warning goes away. I will keep at it to create a simple test case an attach
it later.


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