// RUN: clang-cc -fsyntax-only -verify %s template struct is_same { static const bool value = false; }; template struct is_same { static const bool value = true; }; template struct metafun_apply2 { typedef typename MetaFun::template apply inner; typedef typename inner::type type; }; template struct pair; struct make_pair { template struct apply { typedef pair type; }; }; int a0[is_same::type, pair >::value? 1 : -1]; int a1[is_same< typename make_pair::template apply, make_pair::apply >::value? 1 : -1]; template struct swap_and_apply2 { template struct apply { typedef typename MetaFun::template apply new_metafun; typedef typename new_metafun::type type; }; }; int a2[is_same::apply::type, pair >::value? 1 : -1]; template struct swap_and_apply2b { template struct apply { typedef typename MetaFun::template apply::type type; }; }; int a3[is_same::apply::type, pair >::value? 1 : -1]; template struct X0 { template struct Inner; void f0(X0::Inner); // expected-note{{here}} void f0(typename X0::Inner); // expected-error{{redecl}} void f1(X0::Inner); // expected-note{{here}} void f1(typename X0::template Inner); // expected-error{{redecl}} void f2(typename X0::Inner::type); // expected-note{{here}} void f2(typename X0::template Inner::type); // expected-error{{redecl}} };