__extension__ typedef __SIZE_TYPE__ size_t;
namespace std { struct type_info; }
namespace dr400 { struct A { int a; struct a {}; }; struct B { int a; struct a {}; }; struct C : A, B { using A::a; struct a b; };
struct D : A, B { using A::a; using B::a; struct a b; }; struct E : A, B { struct a b; }; }
namespace dr401 { template<class T, class U = typename T::type> class A : public T {};
class B {
protected:
typedef int type; #if __cplusplus == 199711L
#endif
};
class C {
typedef int type; friend class A<C>; };
class D {
typedef int type; friend class A<D, int>;
};
A<B> *b; A<D> *d;
struct E {
template<class T, class U = typename T::type> class A : public T {};
};
class F {
typedef int type;
friend class E;
};
E::A<F> eaf;
template<class T, class U = typename T::type> void f(T) {}
void g(B b) { f(b); }
#if __cplusplus < 201103L
#else
#endif
}
namespace dr403 { namespace A {
struct S {};
int f(void*);
}
template<typename T> struct X {};
typedef struct X<A::S>::X XS;
XS *p;
int k = f(p); }
namespace dr406 { typedef struct {
static int n; } A;
typedef union {
static int n; } B;
}
namespace dr407 { struct S;
typedef struct S S;
void f() {
struct S *p;
{
typedef struct S S; struct S *p; }
}
struct S {};
namespace UsingDir {
namespace A {
struct S {}; }
namespace B {
typedef int S; }
namespace C {
using namespace A;
using namespace B;
struct S s; }
namespace D {
using A::S;
typedef struct S S;
struct S s;
}
namespace E {
typedef A::S S;
using A::S;
struct S s;
}
namespace F {
typedef A::S S;
}
namespace G {
using namespace A;
using namespace F;
struct S s;
}
namespace H {
using namespace F;
using namespace A;
struct S s;
}
}
}
namespace dr408 { template<int N> void g() { int arr[N != 1 ? 1 : -1]; }
template<> void g<2>() { }
template<typename T> struct S {
static int i[];
void f();
};
template<typename T> int S<T>::i[] = { 1 };
template<typename T> void S<T>::f() {
g<sizeof (i) / sizeof (int)>();
}
template<> int S<int>::i[] = { 1, 2 };
template void S<int>::f();
template<typename T> struct R {
static int arr[];
void f();
};
template<typename T> int R<T>::arr[1];
template<typename T> void R<T>::f() {
int arr[sizeof(arr) != sizeof(int) ? 1 : -1];
}
template<> int R<int>::arr[2];
template void R<int>::f();
}
namespace dr409 { template<typename T> struct A {
typedef int B;
B b1;
A::B b2;
A<T>::B b3;
A<T*>::B b4; };
}
namespace dr410 { template<class T> void f(T);
void g(int);
namespace M {
template<class T> void h(T);
template<class T> void i(T);
struct A {
friend void f<>(int);
friend void h<>(int);
friend void g(int);
template<class T> void i(T);
friend void i<>(int);
private:
static void z(); };
template<> void h(int) { A::z(); }
template<> void i(int) { A::z(); }
}
template<> void f(int) { M::A::z(); }
void g(int) { M::A::z(); } }
namespace dr413 { struct S {
int a;
int : 17;
int b;
};
S s = { 1, 2, 3 };
struct E {};
struct T { int a;
E e;
int b;
};
T t1 = { 1, {}, 2 };
T t2 = { 1, 2 }; }
namespace dr414 { struct X {};
void f() {
X x;
struct X {};
x.~X();
}
}
namespace dr415 { template<typename T> void f(T, ...) { T::error; }
void f(int, int);
void g() { f(0, 0); } }
namespace dr416 { extern struct A a;
int &operator+(const A&, const A&);
int &k = a + a;
struct A { float &operator+(A&); };
float &f = a + a;
}
namespace dr417 { struct A;
struct dr417::A {}; struct B { struct X; };
struct C : B {};
struct C::X {}; struct B::X { struct Y; };
struct C::X::Y {}; namespace N {
struct D;
struct E;
struct F;
struct H;
}
using N::D;
struct dr417::D {}; using namespace N;
struct dr417::E {}; struct N::F {};
struct G;
using N::H;
namespace M {
struct dr417::G {}; struct dr417::H {}; }
}
namespace dr420 { template<typename T> struct ptr {
T *operator->() const;
T &operator*() const;
};
template<typename T, typename P> void test(P p) {
p->~T();
p->T::~T();
(*p).~T();
(*p).T::~T();
}
struct X {};
template void test<int>(int*);
template void test<int>(ptr<int>);
template void test<X>(X*);
template void test<X>(ptr<X>);
template<typename T>
void test2(T p) {
p->template Y<int>::~Y<int>();
p->~Y<int>();
p->template ~Y<int>(); }
template<typename T> struct Y {};
template void test2(Y<int>*);
template void test2(ptr<Y<int> >);
void test3(int *p, ptr<int> q) {
typedef int Int;
p->~Int();
q->~Int();
p->Int::~Int();
q->Int::~Int();
}
#if __cplusplus >= 201103L
template<typename T> using id = T;
struct A { template<typename T> using id = T; };
void test4(int *p, ptr<int> q) {
p->~id<int>();
q->~id<int>();
p->id<int>::~id<int>();
q->id<int>::~id<int>();
p->template id<int>::~id<int>(); q->template id<int>::~id<int>(); p->A::template id<int>::~id<int>();
q->A::template id<int>::~id<int>();
}
#endif
}
namespace dr421 { struct X { X(); int n; int &r; };
int *p = &X().n; int *q = &X().r;
}
namespace dr422 { template<typename T, typename U> void f() {
typedef T type; typedef U type; }
template void f<int, int>();
template void f<int, char>(); }
namespace dr423 { template<typename T> struct X { operator T&(); };
void f(X<int> x) { x += 1; }
}
namespace dr424 { struct A {
typedef int N; typedef int N;
struct X;
typedef X X; struct X {};
struct X *p;
struct A::X *q;
X *r;
typedef X X; };
struct B {
typedef int N;
};
struct C : B {
typedef int N; typedef int N; };
}
namespace dr425 { struct A { template<typename T> operator T() const; } a;
float f = 1.0f * a;
template<typename T> struct is_float;
template<> struct is_float<float> { typedef void type; };
struct B {
template<typename T, typename U = typename is_float<T>::type> operator T() const; } b;
float g = 1.0f * b; }
namespace dr427 { struct B {};
struct D : public B {
D(B &) = delete; };
extern D d1;
B &b = d1;
const D &d2 = static_cast<const D&>(b);
const D &d3 = (const D&)b;
const D &d4(b); }
namespace dr428 { template<typename T> T make();
extern struct X x; void f() {
throw void(); throw make<void*>();
throw make<const volatile void*>();
throw x; throw make<X&>(); throw make<X*>(); throw make<const volatile X&>(); throw make<const volatile X*>(); }
}
namespace dr429 { struct A {
static void *operator new(size_t, size_t);
static void operator delete(void*, size_t);
} *a = new (0) A;
#if __cplusplus >= 201103L
#endif
struct B {
static void *operator new(size_t, size_t);
static void operator delete(void*);
static void operator delete(void*, size_t);
} *b = new (0) B; }
namespace dr430 { void f(int n) {
int a[] = { n++, n++, n++ };
#if __cplusplus < 201103L
#endif
}
}
namespace dr431 { struct A {
template<typename T> T *get();
template<typename T> struct B {
template<typename U> U *get();
};
};
template<typename T> void f(A a) {
a.get<A>()->get<T>();
a.get<T>()
->get<T>(); a.get<T>()->template get<T>();
a.A::get<T>();
A::B<int> *b = a.get<A::B<int> >();
b->get<int>();
b->A::B<int>::get<int>();
b->A::B<int>::get<T>();
b->A::B<T>::get<int>(); b->A::B<T>::template get<int>();
b->A::B<T>::get<T>(); b->A::B<T>::template get<T>();
A::B<T> *c = a.get<A::B<T> >();
c->get<int>(); c->template get<int>();
}
}
namespace dr432 { template<typename T> struct A {};
template<typename T> struct B : A<B> {}; template<typename T> struct C : A<C<T> > {};
#if __cplusplus >= 201103L
template<typename T> struct D : decltype(A<D>()) {}; #endif
}
namespace dr433 { template<class T> struct S {
void f(union U*);
};
U *p;
template<class T> void S<T>::f(union U*) {}
S<int> s;
}
namespace dr434 { void f() {
const int ci = 0;
int *pi = 0;
const int *&rpci = pi; const int * const &rcpci = pi; rpci = &ci;
*pi = 1;
}
#if __cplusplus >= 201103L
int *pi = 0;
const int * const &rcpci = pi;
static_assert(&rcpci == &pi, "");
#endif
}
namespace dr436 { enum E { f }; void f(); }
namespace dr437 { template<typename U> struct T : U {};
struct S {
void f() throw(S);
#if __cplusplus > 201402L
#endif
void g() throw(T<S>);
#if __cplusplus > 201402L
#endif
struct U;
void h() throw(U);
#if __cplusplus > 201402L
#endif
struct U {};
};
}
namespace dr444 { struct D;
struct B { D &operator=(D &) = delete; };
struct D : B { using B::operator=;
} extern d;
void f() {
d = d; }
}
namespace dr445 { class A { void f(); }; struct B {
friend void A::f(); };
}
namespace dr446 { struct C;
struct A {
A();
A(const A&) = delete; A(const C&);
};
struct C : A {};
void f(A a, bool b, C c) {
void(b ? a : a);
b ? A() : a; b ? a : A(); b ? A() : A();
#if __cplusplus <= 201402L
#endif
void(b ? a : c);
b ? a : C(); b ? c : A();
#if __cplusplus <= 201402L
#endif
b ? A() : C();
#if __cplusplus <= 201402L
#endif
}
}
namespace dr447 { struct A { int n; int a[4]; };
template<int> struct U {
typedef int type;
template<typename V> static void h();
};
template<typename T> U<sizeof(T)> g(T);
template<typename T, int N> void f(int n) {
g(__builtin_offsetof(A, n)).h<int>();
g(__builtin_offsetof(T, n)).h<int>();
U<__builtin_offsetof(A, n)>::type a;
U<__builtin_offsetof(T, n)>::type b; g(__builtin_offsetof(A, a[0])).h<int>();
g(__builtin_offsetof(A, a[N])).h<int>();
U<__builtin_offsetof(A, a[0])>::type c;
U<__builtin_offsetof(A, a[N])>::type d; }
}
namespace dr448 { template<typename T = int> void f(int); template<typename T> void g(T t) {
f<T>(t); dr448::f(t); }
template<typename T> void f(T); namespace HideFromADL { struct X {}; }
template void g(int); template void g(HideFromADL::X); }
namespace dr450 { typedef int A[3];
void f1(const A &);
void f2(A &); struct S { A n; };
void g() {
f1(S().n);
f2(S().n); }
#if __cplusplus >= 201103L
void h() {
f1(A{});
f2(A{}); }
#endif
}
namespace dr451 { const int a = 1 / 0; const int b = 1 / 0; int arr[b]; }
namespace dr452 { struct A {
int a, b, c;
A *p;
int f();
A() : a(f()), b(this->f() + a), c(this->a), p(this) {}
};
}
namespace dr456 { const int null = 0;
void *p = null;
#if __cplusplus >= 201103L
#else
#endif
const bool f = false;
void *q = f;
#if __cplusplus >= 201103L
#else
#endif
}
namespace dr457 { const int a = 1;
const volatile int b = 1;
int ax[a];
int bx[b];
enum E {
ea = a,
eb = b };
}
namespace dr458 { struct A {
int T;
int f();
template<typename> int g();
};
template<typename> struct B : A {
int f();
template<typename> int g();
template<typename> int h();
};
int A::f() {
return T;
}
template<typename T> int A::g() {
return T; }
template<typename T>
int B<T>::f() {
return T;
}
template<typename T> template<typename U>
int B<T>::g() {
return T;
}
template<typename U> template<typename T> int B<U>::h() {
return T; }
}
namespace dr460 { namespace X { namespace Q { int n; } }
namespace Y {
using X; using dr460::X; using X::Q; }
}
namespace dr466 { typedef int I;
typedef const int CI;
typedef volatile int VI;
void f(int *a, CI *b, VI *c) {
a->~I();
a->~CI();
a->~VI();
a->I::~I();
a->CI::~CI();
a->VI::~VI();
a->CI::~VI();
b->~I();
b->~CI();
b->~VI();
b->I::~I();
b->CI::~CI();
b->VI::~VI();
c->~I();
c->~CI();
c->~VI();
c->I::~I();
c->CI::~CI();
c->VI::~VI();
}
}
namespace dr467 { int stuff();
int f() {
static bool done;
if (done)
goto later;
static int k = stuff();
done = true;
later:
return k;
}
int g() {
goto later; int k = stuff(); later:
return k;
}
}
namespace dr468 { template<typename> struct A {
template<typename> struct B {
static int C;
};
};
int k = dr468::template A<int>::template B<char>::C;
#if __cplusplus < 201103L
#endif
}
namespace dr469 { template<typename T> struct X; template<typename T> struct X<const T> {};
X<int&> x; }
namespace dr470 { template<typename T> struct A {
struct B {};
};
template<typename T> struct C {
};
template struct A<int>; template struct A<int>::B;
template struct A<char>;
template struct C<char>;
}
namespace dr471 { struct A { int n; };
struct B : private virtual A {};
struct C : protected virtual A {};
struct D : B, C { int f() { return n; } };
struct E : private virtual A {
using A::n;
};
struct F : E, B { int f() { return n; } };
struct G : virtual A {
private:
using A::n; };
struct H : B, G { int f() { return n; } }; }
namespace dr474 { namespace N {
struct S {
void f();
};
}
void N::S::f() {
void g(); }
int g();
namespace N {
int g(); }
}
namespace dr477 { struct A {
explicit A();
virtual void f();
};
struct B {
friend explicit A::A(); friend virtual void A::f(); };
explicit A::A() {} virtual void A::f() {} }
namespace dr478 { struct A { virtual void f() = 0; }; void f(A *a);
void f(A a[10]); }
namespace dr479 { struct S {
S();
private:
S(const S&); ~S(); };
void f() {
throw S();
#if __cplusplus < 201103L
#endif
#if __cplusplus <= 201402L
#endif
}
void g() {
S s; throw s;
}
void h() {
try {
f();
g();
} catch (S s) {
}
}
}
namespace dr480 { struct A { int n; };
struct B : A {};
struct C : virtual B {};
struct D : C {};
int A::*a = &A::n;
int D::*b = a;
extern int D::*c;
int A::*d = static_cast<int A::*>(c);
D *e;
A *f = e;
D *g = static_cast<D*>(f);
extern D &i;
A &j = i;
D &k = static_cast<D&>(j); }
namespace dr481 { template<class T, T U> class A { T *x; };
T *x;
template<class T *U> class B { T *x; };
T *y;
struct C {
template<class T> void f(class D *p);
};
D *z;
template<typename A = C, typename C = A> struct E {
void f() {
typedef ::dr481::C c; typedef C c; }
};
template struct E<>; template struct E<int>;
template<template<typename U_no_typo_correction> class A,
A<int> *B,
U_no_typo_correction *C> struct F {
U_no_typo_correction *x; };
template<template<class H *> class> struct G {
H *x;
};
H *q;
typedef int N;
template<N X, typename N, template<N Y> class T> struct I;
template<char*> struct J;
I<123, char*, J> *j;
}
namespace dr482 { extern int a;
void f();
int dr482::a = 0; void dr482::f() {}
inline namespace X { extern int b;
void g();
struct S;
}
int dr482::b = 0; void dr482::g() {} struct dr482::S {};
void dr482::f(); void dr482::g();
namespace N { typedef int type; }
typedef int N::type; struct A {
struct B;
struct A::B {};
#if __cplusplus >= 201103L
enum class C;
enum class A::C {}; #endif
};
}
namespace dr483 { namespace climits {
int check1[__SCHAR_MAX__ >= 127 ? 1 : -1];
int check2[__SHRT_MAX__ >= 32767 ? 1 : -1];
int check3[__INT_MAX__ >= 32767 ? 1 : -1];
int check4[__LONG_MAX__ >= 2147483647 ? 1 : -1];
int check5[__LONG_LONG_MAX__ >= 9223372036854775807 ? 1 : -1];
#if __cplusplus < 201103L
#endif
}
namespace cstdint {
int check1[__PTRDIFF_WIDTH__ >= 16 ? 1 : -1];
int check2[__SIG_ATOMIC_WIDTH__ >= 8 ? 1 : -1];
int check3[__SIZE_WIDTH__ >= 16 ? 1 : -1];
int check4[__WCHAR_WIDTH__ >= 8 ? 1 : -1];
int check5[__WINT_WIDTH__ >= 16 ? 1 : -1];
}
}
namespace dr484 { struct A {
A();
void f();
};
typedef const A CA;
void CA::f() {
this->~CA();
this->CA::~A();
this->CA::A::~A();
}
CA::A() {}
struct B : CA {
B() : CA() {}
void f() { return CA::f(); }
};
struct C;
typedef C CT; struct CT {};
namespace N {
struct D;
typedef D DT; }
struct N::DT {};
typedef struct {
S(); } S;
}
namespace dr485 { namespace N {
struct S {};
int operator+(S, S);
template<typename T> int f(S);
}
template<typename T> int f();
N::S s;
int a = operator+(s, s);
int b = f<int>(s);
}
namespace dr486 { template<typename T> T f(T *); int &f(...);
void g();
int n[10];
void h() {
int &a = f(&g);
int &b = f(&n);
f<void()>(&g); f<int[10]>(&n); }
}
namespace dr487 { enum E { e };
int operator+(int, E); int i[4 + e]; }
namespace dr488 { template <typename T> void f(T);
void f(int);
void g() {
enum E { e };
f(e);
#if __cplusplus < 201103L
#endif
}
}
namespace dr490 { template<typename T> struct X {};
struct A {
typedef int T;
struct K {};
int f(T);
int g(T);
int h(X<T>);
int X<T>::*i(); int K::*j();
template<typename T> T k();
operator X<T>();
};
struct B {
typedef char T;
typedef int U;
friend int A::f(T);
friend int A::g(U);
friend int A::h(X<T>);
friend int X<T>::*A::i(); friend int K::*A::j();
friend char A::k<T>();
friend int A::k<U>();
friend A::operator X<T>();
};
}
namespace dr491 { struct A {} a, b[3] = { a, {} };
A c[2] = { a, {}, b[1] }; }
namespace dr493 { struct X {
template <class T> operator const T &() const;
};
void f() {
if (X()) {
}
}
}
namespace dr494 { class A {
class B {};
friend class C;
};
class C : A::B {
A::B x;
class D : A::B {
A::B y;
};
};
}
namespace dr495 { template<typename T>
struct S {
operator int() { return T::error; }
template<typename U> operator U();
};
S<int> s;
long n = s;
template<typename T>
struct S2 {
template<typename U> operator U();
operator int() { return T::error; }
};
S2<int> s2;
long n2 = s2;
}
namespace dr496 { struct A { int n; };
struct B { volatile int n; };
int check1[ __is_trivially_copyable(const int) ? 1 : -1];
int check2[ __is_trivially_copyable(volatile int) ? 1 : -1];
int check3[ __is_trivially_constructible(A, const A&) ? 1 : -1];
int check4[ __is_trivially_constructible(B, const B&) ? 1 : -1];
int check5[ __is_trivially_assignable(A, const A&) ? 1 : -1];
int check6[ __is_trivially_assignable(B, const B&) ? 1 : -1];
}
namespace dr497 { void before() {
struct S {
mutable int i;
};
const S cs;
int S::*pm = &S::i;
cs.*pm = 88; }
void after() {
struct S {
S() : i(0) {}
mutable int i;
};
const S cs;
int S::*pm = &S::i;
cs.*pm = 88; }
}
namespace dr499 { extern char str[];
void f() { throw str; }
}