template-id-expr.cpp [plain text]
template<typename FromCl>
struct isa_impl_cl {
template<class ToCl>
static void isa(const FromCl &Val) { }
};
template<class X, class Y>
void isa(const Y &Val) { return isa_impl_cl<Y>::template isa<X>(Val); }
class Value;
void f0(const Value &Val) { isa<Value>(Val); }
template<typename T>
struct X0 {
template<typename U>
void f1();
template<typename U>
void f2(U) {
f1<U>();
}
};
void test_X0_int(X0<int> xi, float f) {
xi.f2(f);
}
template<typename F>
struct Y {
Y(const F&);
};
template<int I>
struct X {
X(int, int);
void f() {
Y<X<I> >(X<I>(0, 0));
Y<X<I> >(::X<I>(0, 0));
}
};
template struct X<3>;
struct Y0 {
template<typename U>
void f1(U);
template<typename U>
static void f2(U);
void f3(int);
static int f4(int);
template<typename U>
static void f4(U);
template<typename U>
void f() {
Y0::template f1<U>(0);
Y0::template f1(0);
this->template f1(0);
Y0::template f2<U>(0);
Y0::template f2(0);
Y0::template f3(0); Y0::template f3();
int x;
x = Y0::f4(0);
x = Y0::f4<int>(0); x = Y0::template f4(0);
x = this->f4(0);
x = this->f4<int>(0); x = this->template f4(0); }
};
struct A {
template<int I>
struct B {
static void b1();
};
};
template<int I>
void f5() {
A::template B<I>::template b1(); }
template void f5<0>();