1 // Origin PR c++/43800 2 // { dg-do compile } 3 4 template<class T, class U=T> 5 struct V 6 { 7 typedef T t_type; 8 }; 9 10 template<class T> 11 class J 12 { 13 typedef typename V<T>::t_type t_type; 14 const t_type& f(); // #0: 15 private: 16 t_type b; 17 }; 18 19 template<class T> f()20const typename V<T>::t_type& J<T>::f() {return b;} // #1 21 22