From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28064 invoked by alias); 10 Aug 2004 14:31:04 -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 28032 invoked by uid 48); 10 Aug 2004 14:30:57 -0000 Date: Tue, 10 Aug 2004 14:31:00 -0000 From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040810143044.16965.bangerth@dealii.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/16965] New: [3.4/3.5 regression] Confusing mismatch in error messages X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg00808.txt.bz2 List-Id: Consider this little example, derived from PR 16963: ------------- template struct B { static int Bar(T); }; struct D : B, B {}; int i1 = D().Bar(1); int i2 = D::Bar(2); ------------- Note that Bar() is static, so trying to call it via D().Bar or D::Bar shouldn't make a difference (for a moment ignore the fact that the code doesn't compile at all, probably for a good reason, as discussed in PR 16963). However, we get this confusing mismatch in error messages: g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc x.cc:6: error: request for member `Bar' is ambiguous x.cc:2: error: candidates are: static int B::Bar(T) [with T = char] x.cc:2: error: static int B::Bar(T) [with T = int] x.cc:7: error: `Bar' is not a member of `D' The error message in line 7 is clearly not helpful, and wrong above that. It should simply read the same as the ambiguity message in line 6. This is a regression in 3.4 and mainline over previous versions that simply printed as expected: g/x> /home/bangerth/bin/gcc-3.3*/bin/c++ -c x.cc x.cc:6: error: request for member `Bar' is ambiguous x.cc:2: error: candidates are: static int B::Bar(T) [with T = char] x.cc:2: error: static int B::Bar(T) [with T = int] x.cc:7: error: request for member `Bar' is ambiguous x.cc:2: error: candidates are: static int B::Bar(T) [with T = char] x.cc:2: error: static int B::Bar(T) [with T = int] W. -- Summary: [3.4/3.5 regression] Confusing mismatch in error messages Product: gcc Version: 3.4.1 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bangerth at dealii dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16965