public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15383] New: name lookup and dependent bases
@ 2013-04-19 18:06 tromey at redhat dot com
2013-10-31 19:45 ` [Bug c++/15383] " tromey at redhat dot com
0 siblings, 1 reply; 2+ messages in thread
From: tromey at redhat dot com @ 2013-04-19 18:06 UTC (permalink / raw)
To: gdb-prs
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<typename T>
struct Base {
int f() { return 13; }
};
template<typename T>
struct Derived : public Base<T> {
int g() { return f(); }
};
int main()
{
Derived<int> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/15383] name lookup and dependent bases
2013-04-19 18:06 [Bug c++/15383] New: name lookup and dependent bases tromey at redhat dot com
@ 2013-10-31 19:45 ` tromey at redhat dot com
0 siblings, 0 replies; 2+ messages in thread
From: tromey at redhat dot com @ 2013-10-31 19:45 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=15383
Tom Tromey <tromey at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |16106
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-31 19:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-19 18:06 [Bug c++/15383] New: name lookup and dependent bases tromey at redhat dot com
2013-10-31 19:45 ` [Bug c++/15383] " tromey at redhat dot com
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).