// { dg-do compile } struct A {}; template struct B { T a, b; B() {} B(T x, T y) : a(x), b(y) {} template operator B () const { return B((U)(this->a), (U)(this->b)); } }; template struct C : public B { T *c; inline T & operator *() { return *c; } }; template struct D : virtual public C { }; void foo (D x) { *x; }