From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23097 invoked by alias); 27 Jun 2004 17:19:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 23090 invoked by uid 48); 27 Jun 2004 17:19:31 -0000 Date: Sun, 27 Jun 2004 17:23:00 -0000 From: "igodard at pacbell dot net" To: gcc-bugs@gcc.gnu.org Message-ID: <20040627171930.16232.igodard@pacbell.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/16232] New: Poor diagnostic X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg03443.txt.bz2 List-Id: template struct A { template void Foo(){} }; templatestruct B { void Bar(V* v) { v->template Foo(); v->Foo(); } }; int main() { A a; B > b; b.Bar(&a); } gets you: ~/ootbc/common/test/src$ g++ foo.cc foo.cc: In member function `void B::Bar(V*) [with V = A]': foo.cc:12: instantiated from here foo.cc:6: error: no matching function for call to `A::Foo()' As with many other g++ diagnostics, the error message is a true statement but not very helpful to the user. Something like: "Call to 'A::Foo()' is ambiguous. Candidates are: foo.cc/6: template void Foo(){} }; May need explicit qualification of function name" would help a lot. FWIW, Comeau is not that much better: "ComeauTest.c", line 6: error: no instance of function template "A::Foo [with T=bool]" matches the argument list object type is: A v->Foo(); ^ detected during instantiation of "void B::Bar(V *) [with V=A]" at line 12 -- 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=16232