public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20576] New: poor diagnostic
@ 2005-03-21 12:26 igodard at pacbell dot net
  2005-03-21 12:39 ` [Bug c++/20576] " igodard at pacbell dot net
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: igodard at pacbell dot net @ 2005-03-21 12:26 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-06-20  3:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-21 12:26 [Bug c++/20576] New: poor diagnostic igodard at pacbell dot net
2005-03-21 12:39 ` [Bug c++/20576] " igodard at pacbell dot net
2005-03-21 22:05 ` bangerth at dealii dot org
2005-06-20  3:01 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).