The code snippet below fails to compile:

=~=
template <typename S, typename T>
struct C
{
  template <typename U>
  struct B
  {
    template <typename W>
    struct E
    {
      explicit E(const W &x) : w(x) {}
      const W &w;
    };
  };
};
struct F;
template <typename X>
struct D
{
  D() {}
};
const D<F> g;
template <typename S, typename T>
struct A
{
  template <typename U>
  struct B : C<S, T>::template B<U>
  {
    typedef typename C<S, T>::template B<U> V;
    static const D<typename V::template E<D<F> > > a;
  };
};
template <typename S, typename T>
template <typename U>
const D<typename C<S, T>::template B<U>::template E<D<F> > >
A<S, T>::B<U>::a = typename C<S, T>::template B<U>::template E<D<F> >(g);
=~=

With the error message:

test-620095.cc:38:16: erreur: conflicting declaration ‘const D<typename C<S,
T>::B<U>::E<D<F> > > A<S, T>::B<U>::a’
test-620095.cc:31:52: erreur: ‘A<S, T>::B<U>::a’ has a previous declaration as
‘const D<typename C<S, T>::B<U>::E<D<F> > > A<S, T>::B<U>::a’
test-620095.cc:38:16: erreur: declaration of ‘const D<typename C<S,
T>::B<U>::E<D<F> > > A<S, T>::B<U>::a’ outside of class is not definition
[-fpermissive]

Fixing PR c++/45200 should fix this bug.


-- 
           Summary: typedef of typename fails to equal its underlying type
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dodji at gcc dot gnu dot org
 BugsThisDependsOn: 45200


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45558

Reply via email to