template<int N>
struct ValueInit0 {
int f() {
return int();
}
};
template struct ValueInit0<5>;
template<int N>
struct FunctionalCast0 {
int f() {
return int(N);
}
};
template struct FunctionalCast0<5>;
struct X { #if __cplusplus >= 201103L
#endif
X(int, int); };
template<int N, int M>
struct BuildTemporary0 {
X f() {
return X(N, M);
}
};
template struct BuildTemporary0<5, 7>;
template<int N, int M>
struct Temporaries0 {
void f() {
(void)X(N, M);
}
};
template struct Temporaries0<5, 7>;
template<int N> struct BadX {
BadX() { int a[-N]; } ~BadX() { int a[-N]; } };
template<int N>
struct PR6671 {
void f() { (void)BadX<1>(); } };
template struct PR6671<1>;
struct Y { };
template<typename T>
struct New0 {
T* f(bool x) {
if (x)
return new T; else
return new T();
}
};
template struct New0<int>;
template struct New0<Y>;
template struct New0<X>;
template<typename T, typename Arg1>
struct New1 {
T* f(bool x, Arg1 a1) {
return new T(a1); }
};
template struct New1<int, float>;
template struct New1<Y, Y>;
template struct New1<X, Y>;
template<typename T, typename Arg1, typename Arg2>
struct New2 {
T* f(bool x, Arg1 a1, Arg2 a2) {
return new T(a1, a2); }
};
template struct New2<X, int, float>;
template struct New2<X, int, int*>;
struct New3 {
New3();
void *operator new[](__SIZE_TYPE__) __attribute__((unavailable)); };
template<class C>
void* object_creator() {
return new C(); }
template void *object_creator<New3[4]>();
template<typename T>
struct Delete0 {
void f(T t) {
delete t; ::delete [] t; }
};
template struct Delete0<int*>;
template struct Delete0<X*>;
template struct Delete0<int>;
namespace PR5755 {
template <class T>
void Foo() {
char* p = 0;
delete[] p;
}
void Test() {
Foo<int>();
}
}
namespace PR10480 {
template<typename T>
struct X {
X();
~X() {
T *ptr = 1; }
};
template<typename T>
void f() {
new X<int>[1]; }
template void f<int>();
}
template<typename T>
struct Throw1 {
void f(T t) {
throw;
throw t; }
};
struct Incomplete;
template struct Throw1<int>;
template struct Throw1<int*>;
template struct Throw1<Incomplete*>;
namespace std {
class type_info;
}
template<typename T>
struct TypeId0 {
const std::type_info &f(T* ptr) {
if (ptr)
return typeid(ptr);
else
return typeid(T); }
};
template<typename T>
struct TypeId1 {
const std::type_info &f() {
return typeid(T); }
};
struct Abstract {
virtual void f() = 0;
};
template struct TypeId0<int>;
template struct TypeId0<Incomplete>; template struct TypeId0<Abstract>;
template struct TypeId1<void() const>; template struct TypeId1<void() &>;
template<typename T>
struct is_pod {
static const bool value = __is_pod(T);
};
static int is_pod0[is_pod<X>::value? -1 : 1];
static int is_pod1[is_pod<Y>::value? 1 : -1];
template<typename T, typename Val1>
struct InitList1 {
void f(Val1 val1) {
T x = { val1 };
#if __cplusplus >= 201103L
#endif
}
};
struct APair {
int *x;
const float *y;
};
template struct InitList1<int[1], float>;
#if __cplusplus >= 201103L
#endif
template struct InitList1<APair, int*>;
template<typename T, typename Val1, typename Val2>
struct InitList2 {
void f(Val1 val1, Val2 val2) {
T x = { val1, val2 }; }
};
template struct InitList2<APair, int*, float*>;
template struct InitList2<APair, int*, double*>;
template<typename T, typename Result>
struct DotMemRef0 {
void f(T t) {
Result result = t.m; }
};
struct MemInt {
int m;
};
struct InheritsMemInt : MemInt { };
struct MemIntFunc {
static int m(int);
};
template struct DotMemRef0<MemInt, int&>;
template struct DotMemRef0<InheritsMemInt, int&>;
template struct DotMemRef0<MemIntFunc, int (*)(int)>;
template struct DotMemRef0<MemInt, float&>;
template<typename T, typename Result>
struct ArrowMemRef0 {
void f(T t) {
Result result = t->m; }
};
template<typename T>
struct ArrowWrapper {
T operator->();
};
template struct ArrowMemRef0<MemInt*, int&>;
template struct ArrowMemRef0<InheritsMemInt*, int&>;
template struct ArrowMemRef0<MemIntFunc*, int (*)(int)>;
template struct ArrowMemRef0<MemInt*, float&>;
template struct ArrowMemRef0<ArrowWrapper<MemInt*>, int&>;
template struct ArrowMemRef0<ArrowWrapper<InheritsMemInt*>, int&>;
template struct ArrowMemRef0<ArrowWrapper<MemIntFunc*>, int (*)(int)>;
template struct ArrowMemRef0<ArrowWrapper<MemInt*>, float&>; template struct ArrowMemRef0<ArrowWrapper<ArrowWrapper<MemInt*> >, int&>;
struct UnresolvedMemRefArray {
int f(int);
int f(char);
};
UnresolvedMemRefArray Arr[10];
template<typename U> int UnresolvedMemRefArrayT(U u) {
return Arr->f(u);
}
template int UnresolvedMemRefArrayT<int>(int);
MemInt &createMemInt(int);
template<int N>
struct NonDepMemberExpr0 {
void f() {
createMemInt(N).m = N;
}
};
template struct NonDepMemberExpr0<0>;
template<typename T, typename Result>
struct MemberFuncCall0 {
void f(T t) {
Result result = t.f();
}
};
template<typename T>
struct HasMemFunc0 {
T f();
};
template struct MemberFuncCall0<HasMemFunc0<int&>, const int&>;
template<typename Result>
struct ThisMemberFuncCall0 {
Result g();
void f() {
Result r1 = g();
Result r2 = this->g();
}
};
template struct ThisMemberFuncCall0<int&>;
template<typename T>
struct NonDepMemberCall0 {
void foo(HasMemFunc0<int&> x) {
T result = x.f(); }
};
template struct NonDepMemberCall0<int&>;
template struct NonDepMemberCall0<const int&>;
template struct NonDepMemberCall0<float&>;
template<typename T>
struct QualifiedDeclRef0 {
T f() {
return is_pod<X>::value; }
};
template struct QualifiedDeclRef0<bool>;
template struct QualifiedDeclRef0<int&>;