template<template<typename T> class X> struct A;
template<template<typename T, int I> class X> struct B;
template<template<int I> class X> struct C;
template<class> struct X; template<int N> struct Y; template<long N> struct Ylong; template<const int &N> struct Yref;
namespace N {
template<class> struct Z;
}
template<class, class> struct TooMany;
A<X> *a1;
A<N::Z> *a2;
A< ::N::Z> *a3;
A<Y> *a4; A<TooMany> *a5; B<X> *a6; C<Y> *a7;
C<Ylong> *a8; C<Yref> *a9;
template<typename T> void f(int);
A<f> *a9;
A<::N::Z> *a10;
#if __cplusplus <= 199711L
#endif
A<: :N::Z> *a11;
namespace N {
template <typename, typename = int>
struct X
{ };
template <typename ,int>
struct Y
{ X<int> const_ref(); };
template <template<typename,int> class TT, typename T, int N>
int operator<<(int, TT<T, N> a) { 0 << a.const_ref(); }
void f0( Y<int,1> y){ 1 << y; } }
template <typename Primitive, template <Primitive...> class F>
#if __cplusplus <= 199711L
#endif
struct unbox_args {
typedef typename Primitive::template call<F> x;
};
template <template <typename> class... Templates>
#if __cplusplus <= 199711L
#endif
struct template_tuple {
#if __cplusplus >= 201103L
static constexpr int N = sizeof...(Templates);
#endif
};
template <typename T>
struct identity {};
template <template <typename> class... Templates>
#if __cplusplus <= 199711L
#endif
template_tuple<Templates...> f7() {}
#if __cplusplus >= 201103L
struct S : public template_tuple<identity, identity> {
static_assert(N == 2, "Number of template arguments incorrect");
};
#endif
void foo() {
f7<identity>();
}
namespace CheckDependentNonTypeParamTypes {
template<template<typename T, typename U, T v> class X> struct A {
void f() {
X<int, void*, 3> x; }
void g() {
X<int, long, 3> x;
}
void h() {
X<unsigned char, int, 1234> x;
int check[x.value == 1234 ? 1 : -1];
}
};
template<typename T, typename U, U v> struct B { static const U value = v;
};
A<B> ab;
void use() {
ab.f(); ab.g();
ab.h();
}
}
namespace PR32185 {
template<template<typename T, T> class U> struct A {};
template<template<typename T, T> class U> struct B : A<U> {};
}
namespace PR10147 {
template<typename T> struct A {};
template<typename T = int> struct A;
template<template<typename...> class A> void f(A<int>*) { A<> a; } void g() { f((A<>*)0); }
}