From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20420 invoked by alias); 19 Apr 2013 18:06:12 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 20389 invoked by uid 48); 19 Apr 2013 18:06:12 -0000 From: "tromey at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/15383] New: name lookup and dependent bases Date: Fri, 19 Apr 2013 18:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-q2/txt/msg00116.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=15383 Bug #: 15383 Summary: name lookup and dependent bases Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned@sourceware.org ReportedBy: tromey@redhat.com Classification: Unclassified Consider this test case: int f() { return 23; } template struct Base { int f() { return 13; } }; template struct Derived : public Base { int g() { return f(); } }; int main() { Derived value; return value.g(); } Here, Derived::g calls ::f, not Base::f. This is due to a C++ name lookup rule, see: http://gcc.gnu.org/onlinedocs/gcc/Name-lookup.html http://gcc.gnu.org/wiki/VerboseDiagnostics#dependent_base gdb implements this wrongly -- if you stop in g and try to call f, gdb will try to call Base::f. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.