namespace std {
template<typename T> struct initializer_list {
T *p;
__SIZE_TYPE__ n;
initializer_list(T*, __SIZE_TYPE__);
};
}
struct X0 { X0(int*, float*); };
template<typename T, typename U>
X0 f0(T t, U u) {
X0 x0(t, u); return X0(t, u); }
void test_f0(int *ip, float *fp, double *dp) {
f0(ip, fp);
f0(ip, dp); }
template<typename Ret, typename T, typename U>
Ret f1(Ret *retty, T t, U u) {
Ret r0(t, u); return Ret(t, u); }
void test_f1(X0 *x0, int *ip, float *fp, double *dp) {
f1(x0, ip, fp);
f1(x0, ip, dp); }
namespace PR6457 {
template <typename T> struct X { explicit X(T* p = 0) { }; };
template <typename T> struct Y { Y(int, const T& x); };
struct A { };
template <typename T>
struct B {
B() : y(0, X<A>()) { }
Y<X<A> > y;
};
B<int> b;
}
namespace PR6657 {
struct X
{
X (int, int) { }
};
template <typename>
void f0()
{
X x = X(0, 0);
}
void f1()
{
f0<int>();
}
}
namespace PR10001 {
template <typename T> struct S {
static const int arr[];
static const int x;
static int f();
};
template <typename T> const int S<T>::arr[] = { 1, 2, 3 };
template <typename T> const int S<T>::x = sizeof(arr) / sizeof(arr[0]);
template <typename T> int S<T>::f() { return x; }
int x = S<int>::f();
}
namespace PR7985 {
template<int N> struct integral_c { };
template <typename T, int N>
integral_c<N> array_lengthof(T (&x)[N]) { return integral_c<N>(); }
template<typename T>
struct Data {
T x;
};
template<typename T>
struct Description {
static const Data<T> data[];
};
template<typename T>
const Data<T> Description<T>::data[] = {{ 1 }};
template<>
const Data<float*> Description<float*>::data[];
void test() {
integral_c<1> ic1 = array_lengthof(Description<int>::data);
(void)sizeof(array_lengthof(Description<float>::data));
(void)sizeof(array_lengthof( Description<int*>::data ));
array_lengthof(Description<float*>::data); }
}
namespace PR13064 {
struct A { explicit A(int); }; template<typename T> struct B { T a { 0 }; };
B<A> b;
template <typename T> struct C { T a = {0}; };
C<A> c; }
namespace PR16903 {
template<typename T>
void fun (T it) {
int m = 0;
for (int i = 0; i < 4; ++i, ++it){
m |= long{char{*it}};
}
}
int test() {
char in[4] = {0,0,0,0};
fun(in);
}
}
namespace ReturnStmtIsInitialization {
struct X {
X() {}
X(const X &) = delete;
};
template<typename T> X f() { return {}; }
auto &&x = f<void>();
}
namespace InitListUpdate {
struct A { int n; };
using AA = A[1];
template <int... N> void f() {
g(AA{0, [0].n = N} ...); g(AA{N, [0].n = 0} ...); };
void g(AA, AA);
void h() { f<1, 2>(); } }
namespace RebuildStdInitList {
struct A { A(std::initializer_list<int>, int = 0) {} };
struct B : A { using A::A; };
struct PES { PES(B); };
template<typename U> void f() { PES({1, 2, 3}); }
void g() { f<int>(); }
}