1 2 3 4 5 6 7 8 9 10 11 12 13 14
// PR c++/21008, DR 515 struct A { int foo_; }; template <typename T> struct B: public A { }; template <typename T> struct C: B<T> { int foo() { return A::foo_; // #1 } }; int f(C<int>* p) { return p->foo(); }