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++/16070] New: Bad error message


In:

#include    <iostream>
class A{};


template<typename T>
void    Bar(const T& t) {}
void    Bar(int i) {}

int main() {
    A a;
    Bar(std::endl);
    }


you get:

~/ootbc/common/test/src$ g++ foo1.cc
foo1.cc: In function `int main()':
foo1.cc:11: error: cannot resolve overloaded function `endl' based on conversion to type `int'


Yet a still different bad message for an ambiguous-overload situation; see bug #16068 and 16069. The bug is that endl is an overloaded function and all overloads ambifuously match the template; it should get a standard identification-ambiguity message with a list of candidates, whereas the compiler seems to be trying to resolve to the one overload (for int) that *none* of the possible arguments can match.

-- 
           Summary: Bad error message
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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