namespace N {
typedef char C;
}
namespace M {
typedef double D;
}
struct NonLiteral { NonLiteral() {}
NonLiteral(int) {}
};
struct Literal {
constexpr Literal() {}
explicit Literal(int); operator int() const { return 0; }
};
struct S {
constexpr S(int, N::C) {}
constexpr S(int, NonLiteral, N::C) {} constexpr S(int, NonLiteral = 42) {}
constexpr S() = default;
constexpr S(Literal) = delete;
};
struct T : virtual S { constexpr T() {} };
namespace IndirectVBase {
struct A {};
struct B : virtual A {}; class C : public B {
public:
constexpr C() {} };
}
struct U {
constexpr U()
try
#ifndef CXX2A
#endif
: u() {
#ifndef CXX14
#endif
} catch (...) {
throw;
}
int u;
};
struct V {
constexpr V() {
;
static_assert(true, "the impossible happened!");
typedef int I;
typedef struct S T;
using J = int;
using K = int[sizeof(I) + sizeof(J)];
struct U;
using N::C;
using namespace N;
}
constexpr V(int(&)[1]) {
for (int n = 0; n < 10; ++n)
;
#ifndef CXX14
#endif
}
constexpr V(int(&)[2]) {
constexpr int a = 0;
#ifndef CXX14
#endif
}
constexpr V(int(&)[3]) {
constexpr int ForwardDecl(int);
#ifndef CXX14
#endif
}
constexpr V(int(&)[4]) {
typedef struct { } S1;
#ifndef CXX14
#endif
}
constexpr V(int(&)[5]) {
using S2 = struct { };
#ifndef CXX14
#endif
}
constexpr V(int(&)[6]) {
struct S3 { };
#ifndef CXX14
#endif
}
constexpr V(int(&)[7]) {
return;
#ifndef CXX14
#endif
}
};
struct W {
int n;
constexpr W() {}
#ifndef CXX2A
#endif
};
struct AnonMembers {
int a; union { char b;
struct {
double c;
long d; };
union {
char e;
void *f;
};
};
struct { long long g;
struct {
int h; double i; };
union { char *j;
AnonMembers *k;
};
};
constexpr AnonMembers(int(&)[1]) : a(), b(), g(), h(), i(), j() {} constexpr AnonMembers(int(&)[2]) : a(), c(), g(), h() {}
#ifndef CXX2A
#endif
constexpr AnonMembers(int(&)[3]) : a(), e(), g(), h(), i(), k() {} constexpr AnonMembers(int(&)[4]) : a(), c(), d(), g(), i() {}
#ifndef CXX2A
#endif
constexpr AnonMembers(int(&)[5]) : a(), g(), h(), i(), k() {}
#ifndef CXX2A
#endif
constexpr AnonMembers(int(&)[6]) {}
#ifndef CXX2A
#endif
};
union Empty {
constexpr Empty() {} } constexpr empty1;
struct EmptyVariant {
union {}; struct {}; constexpr EmptyVariant() {} } constexpr empty2;
template<typename T> using Int = int;
template<typename T>
struct TemplateInit {
T a;
int b; Int<T> c; struct {
T d;
int e; Int<T> f; };
struct {
Literal l;
Literal m;
Literal n[3];
};
union { T g;
T h;
};
constexpr TemplateInit() {} };
template<typename T> struct TemplateInit2 {
Literal l;
constexpr TemplateInit2() {} };
template<typename T> struct weak_ptr {
constexpr weak_ptr() : p(0) {}
T *p;
};
template<typename T> struct enable_shared_from_this {
weak_ptr<T> weak_this;
constexpr enable_shared_from_this() {} };
constexpr int f(enable_shared_from_this<int>);
struct ConstexprBaseMemberCtors : Literal {
Literal l;
constexpr ConstexprBaseMemberCtors() : Literal(), l() {} constexpr ConstexprBaseMemberCtors(char) : Literal(0), l() {}
constexpr ConstexprBaseMemberCtors(double) : Literal(), l(0) {}
};
struct X {
int a = 0;
int b = 2 * a + 1;
constexpr X() {}
constexpr X(int c) : a(c) {} };
union XU1 { int a; constexpr XU1() = default; };
#ifndef CXX2A
#endif
union XU2 { int a = 1; constexpr XU2() = default; };
struct XU3 {
union {
int a;
};
constexpr XU3() = default;
#ifndef CXX2A
#endif
};
struct XU4 {
union {
int a = 1;
};
constexpr XU4() = default;
};
static_assert(XU2().a == 1, "");
static_assert(XU4().a == 1, "");
int kGlobal; struct Z {
constexpr Z(int a) : n(a) {}
constexpr Z() : n(kGlobal) {} int n;
};
namespace StdExample {
struct Length {
explicit constexpr Length(int i = 0) : val(i) { }
private:
int val;
};
}
namespace CtorLookup {
struct A {
constexpr A(const A&) {}
A(A&) {}
constexpr A(int = 0);
};
struct B : A {
B() = default;
constexpr B(const B&);
constexpr B(B&);
};
constexpr B::B(const B&) = default;
constexpr B::B(B&) = default;
struct C {
A a;
C() = default;
constexpr C(const C&);
constexpr C(C&);
};
constexpr C::C(const C&) = default;
constexpr C::C(C&) = default; }
namespace PR14503 {
template<typename> struct V {
union {
int n;
struct {
int x,
y; };
};
constexpr V() : x(0) {}
};
constexpr V<int> v;
constexpr int k = V<int>().x; }