Lines Matching full:constexpr
3 // An explicitly-defaulted function may be declared constexpr only if it would
4 // have been implicitly declared as constexpr.
6 constexpr S1() = default; // expected-error {{defaulted definition of default constructor is not constexpr}}
7 constexpr S1(const S1&) = default;
8 constexpr S1(S1&&) = default;
9 constexpr S1 &operator=(const S1&) const = default; // expected-error {{explicitly-defaulted copy assignment operator may not have}}
10 constexpr S1 &operator=(S1&&) const = default; // expected-error {{explicitly-defaulted move assignment operator may not have}}
11 constexpr ~S1() = default; // expected-error {{destructor cannot be marked constexpr}}
15 constexpr NoCopyMove() {}
20 constexpr S2() = default;
21 constexpr S2(const S2&) = default; // expected-error {{defaulted definition of copy constructor is not constexpr}}
22 constexpr S2(S2&&) = default; // expected-error {{defaulted definition of move constructor is not constexpr}}
27 // -- it is implicitly considered to be constexpr if the implicit declaration
33 constexpr S3(int n) : n(n) {}
36 constexpr S3 s3a = S3(0);
37 constexpr S3 s3b = s3a;
38 constexpr S3 s3c = S3();
39 constexpr S3 s3d; // expected-error {{default initialization of an object of const type 'const S3' without a user-provided default constructor}}
47 constexpr S4 s4a{}; // ok
48 constexpr S4 s4b = S4(); // expected-error {{constant expression}} expected-note {{non-constexpr constructor}}
49 constexpr S4 s4c = s4a; // expected-error {{constant expression}} expected-note {{non-constexpr constructor}}
52 constexpr S5();
55 constexpr S5::S5() = default;