1 // { dg-do compile { target c++11 } } 2 3 template <int U> 4 struct TypeA 5 { 6 typedef int type; 7 }; 8 9 template <int N> 10 struct TypeB 11 { 12 template <int U> typename TypeA<U>::type fn(); 13 }; 14 15 struct TypeC 16 { 17 TypeB<10> b; 18 // This was being printed as: 19 // template<int N> 20 // decltype (((TypeC*)this)-> 21 // TypeC::b. 22 // template<int U> typename TypeA<U>::type TypeB::fn [with int U = U, int N = 10, typename TypeA<U>::type = TypeA<U>::type]()) 23 // TypeC::fn() 24 // we don't want to see the template header, return type, or parameter bindings 25 // for TypeB::fn. 26 template <int N> auto fn() -> decltype(b.fn<N>()); // { dg-bogus "typename" } 27 }; 28 main()29int main() 30 { 31 TypeC().fn<4>(1); // { dg-error "no match" } 32 } 33