This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/22013] Default value in template argument list breaks RTTI lookup


https://sourceware.org/bugzilla/show_bug.cgi?id=22013

--- Comment #4 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
When the first reduced test is compiled with Clang there is no missing RTTI
warning:

$ clang++ -ggdb3 -std=c++11 test.cc -Wall -Wextra
$ gdb -q -ex start -ex n -ex "p poly.value" \
  -ex 'python print(str(gdb.parse_and_eval("poly").type.target()))' \
  a.out
Reading symbols from a.out...done.
Temporary breakpoint 1 at 0x400656: file test.cc, line 17.
Starting program: /tmp/a.out 

Temporary breakpoint 1, main () at test.cc:17
17          auto poly = new PolymorphicType<ATemplate<long>::NestedType>();
19          return poly->value;
$1 = 0
PolymorphicType<ATemplate<long, 1000>::NestedType>

Note the second template arg: ^^^^^^

But we still get a warning for the template<auto> case:

$ clang++ -ggdb3 -std=c++1z auto.cc -Wall -Wextra 
$ gdb -q -ex start -ex n -ex "p poly.value" \
  -ex 'python print(str(gdb.parse_and_eval("poly").type.target()))' \
  a.out
Reading symbols from a.out...done.
Temporary breakpoint 1 at 0x400656: file auto.cc, line 16.
Starting program: /tmp/a.out 

Temporary breakpoint 1, main () at auto.cc:16
16          auto poly = new PolymorphicType<AutoTemplate<1u>>();
18          return poly->value;
warning: RTTI symbol not found for class 'PolymorphicType<AutoTemplate<1u> >'
$1 = 0
PolymorphicType<AutoTemplate<1> >

Here Clang shows <1>:       ^^^  (the same as GCC trunk).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]