This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81932] Template arguments of type unsigned generate incorrect debugging information
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 19:06:22 +0000
- Subject: [Bug c++/81932] Template arguments of type unsigned generate incorrect debugging information
- Auto-submitted: auto-generated
- References: <bug-81932-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81932
--- Comment #21 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Xi Ruoyao from comment #20)
> (In reply to Martin Sebor from comment #18)
> > GDB already has a C++ parser. It just isn't good enough. It understands
> > that B<unsigned> and B<unsigned int> are one and the same type but it
> > interprets A<2> and A<2u> as distinct. In my view, this is not just a
> > limitation but a bug.
>
> My point is B<unsigned> and B<unsigned int> are the same symbol (_Z1BIjE),
> but
> A<2> is _Z1AILi2EE, and A<2u> is _Z1AILj2EE.
But if A is a class template A<unsigned> taking an unsigned template argument
then A<2> can only mean the same thing as A<2u>. So there's no problem with
calling it A<2> in the DWARF info.
I agree with Martin that GDB needs to be able to handle this, because the
formatting of non-type template arguments in debuginfo varies between compilers
in other ways too, see
https://sourceware.org/bugzilla/show_bug.cgi?id=21296 and
https://sourceware.org/bugzilla/show_bug.cgi?id=21492
I don't see a GCC bug here.