struct A { int x; };
#if __cplusplus >= 201103L
#endif
class Base {
public:
virtual void f();
};
class Derived : public Base { };
struct ConvertibleToInt {
operator int() const;
};
struct Constructible {
Constructible(int, float);
};
template<typename T, typename U>
struct CStyleCast0 {
void f(T t) {
(void)((U)t); }
};
template struct CStyleCast0<int, float>;
template struct CStyleCast0<A, int>;
template<typename T, typename U>
struct StaticCast0 {
void f(T t) {
(void)static_cast<U>(t); }
};
template struct StaticCast0<ConvertibleToInt, bool>;
template struct StaticCast0<int, float>;
template struct StaticCast0<int, A>;
template<typename T, typename U>
struct DynamicCast0 {
void f(T t) {
(void)dynamic_cast<U>(t); }
};
template struct DynamicCast0<Base*, Derived*>;
template struct DynamicCast0<Base*, A>;
template<typename T, typename U>
struct ReinterpretCast0 {
void f(T t) {
(void)reinterpret_cast<U>(t); }
};
template struct ReinterpretCast0<void (*)(int), void (*)(float)>;
template struct ReinterpretCast0<int const *, float *>;
template<typename T, typename U>
struct ConstCast0 {
void f(T t) {
(void)const_cast<U>(t); }
};
template struct ConstCast0<int const * *, int * *>;
template struct ConstCast0<int const *, float *>;
template<typename T, typename U>
struct FunctionalCast1 {
void f(T t) {
(void)U(t); }
};
template struct FunctionalCast1<int, float>;
template struct FunctionalCast1<A, int>;
template<int N, long M>
struct FunctionalCast2 {
void f() {
(void)Constructible(N, M);
}
};
template struct FunctionalCast2<1, 3>;
template<typename T>
struct Derived2 : public Base { };
void test_derived_to_base(Base *&bp, Derived2<int> *dp) {
bp = dp;
}