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.