1 // PR c++/46046 2 3 template <class T> 4 struct foo 5 { 6 template <class U, class V = void> 7 struct type 8 {}; 9 10 template <class V> 11 struct type< 12 typename T::template some_type<int>, 13 V 14 > 15 {}; 16 }; 17 18 template <class T> 19 class bar 20 {}; 21 22 int main() 23 { 24 typedef foo<bar<int> > cont; 25 cont::type<char> obj; // { dg-error "cannot be defined" } 26 } 27