Lines Matching full:constexpr
11 struct NonLiteral { // expected-note 2{{no constexpr constructors}}
16 constexpr Literal() {}
27 // The definition of a constexpr function shall satisfy the following
30 constexpr T();
31 constexpr int f(); // expected-error {{non-literal type 'T' cannot have constexpr members}}
34 virtual constexpr int ExplicitlyVirtual() { return 0; } // expected-error {{virtual function cannot be constexpr}}
36 constexpr int ImplicitlyVirtual() { return 0; } // expected-error {{virtual function cannot be constexpr}}
39 constexpr NonLiteral NonLiteralReturn() { return {}; } // expected-error {{constexpr function's return type 'NonLiteral' is not a literal type}}
40 constexpr void VoidReturn() { return; } // expected-error {{constexpr function's return type 'void' is not a literal type}}
41 constexpr ~T(); // expected-error {{destructor cannot be marked constexpr}}
43 constexpr F NonLiteralReturn2; // ok until definition
46 constexpr int NonLiteralParam(NonLiteral) { return 0; } // expected-error {{constexpr function's 1st parameter type 'NonLiteral' is not a literal type}}
48 constexpr G NonLiteralParam2; // ok until definition
51 constexpr int Deleted() = delete;
54 // destructor can be defaulted. Destructors can't be constexpr since they
56 // constexpr since they can't be const.
57 constexpr T &operator=(const T&) = default; // expected-error {{an explicitly-defaulted copy assignment operator may not have 'const', 'constexpr' or 'volatile' qualifiers}}
60 constexpr U SelfReturn();
61 constexpr int SelfParam(U);
65 constexpr int F() { return 0; } // expected-error {{constexpr member function not allowed in struct with virtual base class}}
69 constexpr int AllowedStmts() {
94 constexpr int ForStmt() {
95 for (int n = 0; n < 10; ++n) // expected-error {{statement not allowed in constexpr function}}
98 constexpr int VarDecl() {
99 constexpr int a = 0; // expected-error {{variables cannot be declared in a constexpr function}}
102 constexpr int FuncDecl() {
103 constexpr int ForwardDecl(int); // expected-error {{statement not allowed in constexpr function}}
106 constexpr int ClassDecl1() {
107 typedef struct { } S1; // expected-error {{types cannot be defined in a constexpr function}}
110 constexpr int ClassDecl2() {
111 using S2 = struct { }; // expected-error {{types cannot be defined in a constexpr function}}
114 constexpr int ClassDecl3() {
115 struct S3 { }; // expected-error {{types cannot be defined in a constexpr function}}
118 constexpr int NoReturn() {} // expected-error {{no return statement in constexpr function}}
119 constexpr int MultiReturn() {
121 return 0; // expected-error {{multiple return statements in constexpr function}}
129 // a constexpr function must be able to produce a constant expression.
131 constexpr int f(int k) {
136 constexpr int f() { // expected-error {{constexpr function never produces a constant expression}}