------- Additional Comments From jakub at gcc dot gnu dot org  2004-11-12 10:35 
-------
I see segfault in perform_or_defer_access_check too, on:
template <class T1, class T2>
struct P
{
  T1 t1;
  T2 t2;
  P () : t1(), t2() { }
  template <class U1, class U2>
  P (const P<U1, U2> &x) : t1(x.t1), t2(x.t2) { }
};

template <typename T>
inline void
f (T &x, T &y)
{
  const T t = x; x = y; y = t;
}

template <class T>
struct A
{
  static void f (T &x, T &y) { T t = x; x = y; y = t; }
};

template <class T>
struct B : public A<T>
{
  static void g (T *x, T *y) { f (*y, *x); }
};

int
foo ()
{
  P<long, long> *a, *b;
  B<P<long, long> >::g (a, b);
}

Works with GCC 3.3, segfaults with 3.4.3 and 4.0 current.

-- 


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

Reply via email to