https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81932
Simon Marchi <simon.marchi at polymtl dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |simon.marchi at polymtl dot ca
--- Comment #34 from Simon Marchi <simon.marchi at polymtl dot ca> ---
I am looking at addressing this in GDB, and I believe that gcc should really
consider adding back the "u". In C++17, you can end up with two types with the
same DW_AT_name:
```
template <auto v>
struct Foo
{
int x;
};
int main()
{
Foo<2> f1;
Foo<2u> f2;
}
```
In the DWARF, both are named Foo<2>:
```
0x00000033: DW_TAG_structure_type
DW_AT_name ("Foo<2>")
DW_AT_byte_size (4)
DW_AT_decl_file ("/app/example.cpp")
DW_AT_decl_line (3)
DW_AT_decl_column (8)
DW_AT_sibling (0x0000004b)
0x0000003c: DW_TAG_member
DW_AT_name ("x")
DW_AT_decl_file ("/app/example.cpp")
DW_AT_decl_line (5)
DW_AT_decl_column (7)
DW_AT_type (0x0000004b "int")
DW_AT_data_member_location (0)
0x00000043: DW_TAG_template_value_parameter
DW_AT_name ("v")
DW_AT_type (0x0000004b "int")
DW_AT_const_value (2)
0x0000004a: NULL
0x0000004b: DW_TAG_base_type
DW_AT_byte_size (0x04)
DW_AT_encoding (DW_ATE_signed)
DW_AT_name ("int")
0x00000052: DW_TAG_structure_type
DW_AT_name ("Foo<2>")
DW_AT_byte_size (4)
DW_AT_decl_file ("/app/example.cpp")
DW_AT_decl_line (3)
DW_AT_decl_column (8)
DW_AT_sibling (0x0000006a)
0x0000005b: DW_TAG_member
DW_AT_name ("x")
DW_AT_decl_file ("/app/example.cpp")
DW_AT_decl_line (5)
DW_AT_decl_column (7)
DW_AT_type (0x0000004b "int")
DW_AT_data_member_location (0)
0x00000062: DW_TAG_template_value_parameter
DW_AT_name ("v")
DW_AT_type (0x000000a7 "unsigned int")
DW_AT_const_value (2)
```
If the user was to use the "ptype" command on variables of both types, it would
say "Foo<2>" for both, even though they don't have the same type. So I think
that having the u would be useful to avoid any ambiguity.