1 // { dg-do compile } 2 3 struct A {}; 4 5 template <class T> struct B 6 { 7 T a, b; BB8 B() {} BB9 B(T x, T y) : a(x), b(y) {} 10 template <class U> operator B<U> () const 11 { return B<U>((U)(this->a), (U)(this->b)); } 12 }; 13 14 template <class T> struct C : public B<int> 15 { 16 T *c; 17 inline T & operator *() { return *c; } 18 }; 19 20 template <class T> struct D : virtual public C<T> { }; 21 22 void foo(D<A> x)23foo (D<A> x) 24 { 25 *x; 26 } 27