This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/20540] New: Type printer template parameter substitution too greedy
- From: "keiths at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Tue, 30 Aug 2016 18:46:51 +0000
- Subject: [Bug c++/20540] New: Type printer template parameter substitution too greedy
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=20540
Bug ID: 20540
Summary: Type printer template parameter substitution too
greedy
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: c++
Assignee: unassigned at sourceware dot org
Reporter: keiths at redhat dot com
Target Milestone: ---
Consider:
template <typename T>
struct A
{
A (T val) : val_ (val), val2_ (-1) { }
T get (void) const { return val_; }
int add (int a) const { return val_ + a; }
T val_;
int val2_;
};
int
main (void)
{
A<int> a (1);
return a.add (a.get ());
}
Run gdb on resulting executable:
Reading symbols from /home/keiths/tmp/classt2...done.
(gdb) ptype A<int>
type = struct A<int> [with T = int] {
T val_;
T val2_;
public:
A(T);
T get(void) const;
T add(T) const;
}
Neither A::add nor A::val2_ was declared using template parameters, yet the
type printer substituted a template parameter because it saw "int".
--
You are receiving this mail because:
You are on the CC list for the bug.