Home | History | Annotate | Download | only in dcl.constexpr

Lines Matching refs:constexpr

11 struct NonLiteral { // expected-note 2{{no constexpr constructors}}
16 constexpr Literal() {}
21 // In the definition of a constexpr constructor, each of the parameter types
24 constexpr S(int, N::C) {}
25 constexpr S(int, NonLiteral, N::C) {} // expected-error {{constexpr constructor's 2nd parameter type 'NonLiteral' is not a literal type}}
26 constexpr S(int, NonLiteral = 42) {} // expected-error {{constexpr constructor's 2nd parameter type 'NonLiteral' is not a literal type}}
29 constexpr S() = default;
30 constexpr S(Literal) = delete;
37 constexpr T() {} // expected-error {{constexpr constructor not allowed in struct with virtual base class}}
44 constexpr C() {} // expected-error {{constexpr constructor not allowed in class with virtual base class}}
50 constexpr U()
51 try // expected-error {{function try block not allowed in constexpr constructor}}
61 constexpr V() {
84 constexpr V(int(&)[1]) {
85 for (int n = 0; n < 10; ++n) // expected-error {{statement not allowed in constexpr constructor}}
88 constexpr V(int(&)[2]) {
89 constexpr int a = 0; // expected-error {{variables cannot be declared in a constexpr constructor}}
91 constexpr V(int(&)[3]) {
92 constexpr int ForwardDecl(int); // expected-error {{statement not allowed in constexpr constructor}}
94 constexpr V(int(&)[4]) {
95 typedef struct { } S1; // expected-error {{types cannot be defined in a constexpr constructor}}
97 constexpr V(int(&)[5]) {
98 using S2 = struct { }; // expected-error {{types cannot be defined in a constexpr constructor}}
100 constexpr V(int(&)[6]) {
101 struct S3 { }; // expected-error {{types cannot be defined in a constexpr constructor}}
103 constexpr V(int(&)[7]) {
104 return; // expected-error {{statement not allowed in constexpr constructor}}
111 constexpr W() {} // expected-error {{constexpr constructor must initialize all members}}
138 constexpr AnonMembers(int(&)[1]) : a(), b(), g(), h(), i(), j() {} // ok
140 constexpr AnonMembers(int(&)[2]) : a(), c(), g(), h() {} // expected-error {{constexpr constructor must initialize all members}}
141 constexpr AnonMembers(int(&)[3]) : a(), e(), g(), h(), i(), k() {} // ok
143 constexpr AnonMembers(int(&)[4]) : a(), c(), d(), g(), i() {} // expected-error {{constexpr constructor must initialize all members}}
145 constexpr AnonMembers(int(&)[5]) : a(), g(), h(), i(), k() {} // expected-error {{constexpr constructor must initialize all members}}
147 constexpr AnonMembers(int(&)[6]) {} // expected-error {{constexpr constructor must initialize all members}}
151 constexpr Empty() {} // ok
152 } constexpr empty1;
157 constexpr EmptyVariant() {} // ok
158 } constexpr empty2;
181 constexpr TemplateInit() {} // desired-error {{must initialize all members}}
185 constexpr TemplateInit2() {} // ok
189 constexpr weak_ptr() : p(0) {}
194 constexpr enable_shared_from_this() {} // ok
196 constexpr int f(enable_shared_from_this<int>);
199 // class sub-objects shall be a constexpr constructor.
203 constexpr ConstexprBaseMemberCtors() : Literal(), l() {} // ok
204 constexpr ConstexprBaseMemberCtors(char) : // expected-error {{constexpr constructor never produces a constant expression}}
205 Literal(0), // expected-note {{non-constexpr constructor}}
207 constexpr ConstexprBaseMemberCtors(double) : Literal(), // expected-error {{constexpr constructor never produces a constant expression}}
208 l(0) // expected-note {{non-constexpr constructor}}
223 constexpr X() {}
224 constexpr X(int c) : a(c) {} // ok, b initialized by 2 * c + 1
227 union XU1 { int a; constexpr XU1() = default; }; // expected-error{{not constexpr}}
228 union XU2 { int a = 1; constexpr XU2() = default; };
234 constexpr XU3() = default; // expected-error{{not constexpr}}
240 constexpr XU4() = default;
256 constexpr Z(int a) : n(a) {}
257 constexpr Z() : n(kGlobal) {} // expected-error {{constexpr constructor never produces a constant expression}} expected-note {{read of non-const}}
264 explicit constexpr Length(int i = 0) : val(i) { }
273 constexpr A(const A&) {}
275 constexpr A(int = 0);
280 constexpr B(const B&);
281 constexpr B(B&);
283 constexpr B::B(const B&) = default;
284 constexpr B::B(B&) = default; // expected-error {{not constexpr}}
289 constexpr C(const C&);
290 constexpr C(C&);
292 constexpr C::C(const C&) = default;
293 constexpr C::C(C&) = default; // expected-error {{not constexpr}}