sphink at gmail dot com
2018-08-17 18:35:48 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=23545
Bug ID: 23545
Summary: gdb.Type.template_argument(n) sees arguments of
aliased type
Product: gdb
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: sphink at gmail dot com
Target Milestone: ---
Consider:
template <typename T, typename U>
struct InnerType {
T t;
U u;
};
template<typename V>
using OuterType = InnerType<int, V>;
struct Container {
OuterType<float> o;
};
int main() {
Container c;
}
First, if I do `ptype Container`, it shows the field 'o' as having type
"OuterType". I would have expected "OuterType<float>".
But I was really looking at this from the python scripting side.
gdb.lookup_type("Container")['o'].type gives a type t that stringifies to plain
"OuterType". t.template_argument(0) gives 'int', and template_argument(1) gives
'float', which are the template arguments of InnerType, not OuterType.
t.strip_typedefs().template_argument calls correctly give the InnerType values.
Bug ID: 23545
Summary: gdb.Type.template_argument(n) sees arguments of
aliased type
Product: gdb
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: sphink at gmail dot com
Target Milestone: ---
Consider:
template <typename T, typename U>
struct InnerType {
T t;
U u;
};
template<typename V>
using OuterType = InnerType<int, V>;
struct Container {
OuterType<float> o;
};
int main() {
Container c;
}
First, if I do `ptype Container`, it shows the field 'o' as having type
"OuterType". I would have expected "OuterType<float>".
But I was really looking at this from the python scripting side.
gdb.lookup_type("Container")['o'].type gives a type t that stringifies to plain
"OuterType". t.template_argument(0) gives 'int', and template_argument(1) gives
'float', which are the template arguments of InnerType, not OuterType.
t.strip_typedefs().template_argument calls correctly give the InnerType values.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are receiving this mail because:
You are on the CC list for the bug.