// PR c++/14369 struct A { }; template struct X : A { const A* bar() const { return this; } const A& foo() const; }; template const A& X::foo() const { const A* t = bar(); return *(t ? t : throw 0); }