[Fwd: curried template inaccurate names]

Larry Evans jcampbell3@prodigy.net
Fri Jul 14 16:24:00 GMT 2000


I sent the following to maybe the wrong email address:

> uname -a
> Linux localhost.localdomain 2.2.13-4mdk #1 Tue Sep 7 18:23:11 CEST 1999
> i586 unknown
> g++ -v
> Reading specs from
> /home/evansl/prog_dev/gcc_all/gcc-2.96/snap-20000626/lib/gcc-lib/i586-pc-linux/2.96/specs
>
> gcc version 2.96 20000626 (experimental)
> -------------------
> g++ -c bug.cpp 2>&1 | c++filt
> /tmp/ccsHxIB3.s: Assembler messages:
> /tmp/ccsHxIB3.s:63: Fatal error: Symbol B<template <class> class
> C>::C<int>::C(void) already defined.
> -------------------
> cat bug.cpp
> template
>   < typename S
>   , template<typename S>class T
>   >
>   struct
> P
>   { P(void)
>       : m_s(0)
>       {}
>       T<S>*
>     m_s
>       ;
>   };
> template
>   < typename S
>   >
>   struct
> A
>   { S m_s;
>     A(void){}
>   };
> template
>   < template<typename S>class T
>   >
>   struct
> B
>   {
>     template
>       < typename U
>       >
>       struct
>     C
>       : public P<U,T>
>       {
>       };
>   };
> typedef B<A> B1;
> typedef B<B1::C> B2;
> typedef B<B2::C> B3;
>   int
> main(void)
>   {
>   ; B2::C<int> c2
>   ; B3::C<int> c3
>   ; return 0
>   ;}
> -------------------
> The name in the error message:
>   B<template <class> class C>::C<int>::C(void)
> suggests the compiler is not generating accurate names from the
> template instantiations.  The above name should be either:
>
>     B2::C<int>::C(void)
>   = B<B1::C>::C<int>::C(void)
>   = B<B<B<A>::C>::C>::C<int>::C(void)
>
>     B3::C<int>::C(void)
>   = B<B2::C>::C<int>::C(void)
>   = B<B<B<B<A>::C>::C>::C>::C<int>::C(void)



More information about the Gcc-bugs mailing list