[Bug libstdc++/11212] demangler bug
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Wed Jun 25 00:18:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11212
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-06-24 22:54:44
date| |
Summary|invalid template |demangler bug
|instantiations |
------- Additional Comments From bangerth at dealii dot org 2003-06-24 22:54 -------
Confirmed. This looks like a demangler bug to me. Consider this reduced
snippet:
-----------------------------------
class TestClass;
namespace NS {
template <typename> struct S {};
template <typename, typename> struct P {};
template<typename X, typename T> X foo(X, T) {}
template
S<P<char const* const, TestClass*> >**
foo <>
(S<P<char const* const, TestClass*> >**,
S<P<char const* const, TestClass*> >*);
}
-----------------------------------------
Note that in the explicit instantiation, the first argument is a **, while the
second one is just a single *. Now, compile and look at the output of
nm -C:
tmp/gg> c++ -c x.cc
tmp/gg> nm -C x.o
00000000 W NS::S<NS::P<char const* const, TestClass*> >**
NS::foo<NS::S<NS::P<char const* const, TestClass*> >**, NS::S<NS::P<char const*
const, TestClass*> >*>(NS::S<NS::P<char const* const, TestClass*> >*,
NS::S<NS::P<char const* const, TestClass*> >*)
Here, both arguments are single pointers! The mangled symbol for this is
_ZN2NS3fooIPPNS_1SINS_1PIKPKcP9TestClassEEEESA_EET_SC_T0_
but my mental state machine is too small to be able to decipher how this
should really demangle.
Note that this bug really is quite sensitive to any changes. Trying to
further simplify this makes the bug go away. I don't know whether this
bug is actually dependent on the version of the demangler. The one I used
is
tmp/gg> c++filt --version
GNU c++filt (C++ demangler), version 3.2.2
W.
More information about the Gcc-bugs
mailing list