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++/20576] New: poor diagnostic


In:
struct bottom {};
template<typename v, typename next>
struct node: public next { v val; };
enum a {b, c}; enum x{y, z};
struct foo : public node<a,
                    node<x,
                        bottom> > {};
template<typename T, typename U>
void bar(node<T, U>&) {}
int main() { foo f; bar(f); return 0; }


you get:
~/ootbc/members/src$ g++ foo.cc
foo.cc: In function `int main()':
foo.cc:10: error: no matching function for call to `bar(foo&)'

Actually, there is a matching function, but the call is ambiguous because there 
are two matching base classes. The diagnostic should say so and identify the 
matching bases. This is reported correctly by other ambiguous calls where two 
different functions are matches to the argument set. In this case one function 
has two different matches, but the user's need in the diagnostic is the same: 
show what the compiler found.

Ivan

-- 
           Summary: poor diagnostic
           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=20576


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