File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -490,10 +490,10 @@ char8_t utf8_str[] = u8"\u0123";
490
490
The ` constinit ` specifier requires that a variable must be initialized at compile-time.
491
491
``` c++
492
492
const char * g () { return "dynamic initialization"; }
493
- constexpr const char* f(bool p ) { return p ? "constant initializer" : g() ; }
493
+ constexpr const char* f() { return "constant initializer"; }
494
494
495
- constinit const char* c = f(true); // OK
496
- constinit const char* d = g(false); // ERROR: ` g ` is not constexpr, so ` d ` cannot be evaluated at compile-time.
495
+ constinit const char* c = f(); // OK
496
+ constinit const char* d = g(); // ERROR: ` g ` is not constexpr, so ` d ` cannot be evaluated at compile-time.
497
497
```
498
498
499
499
### \_\_VA\_OPT\_\_
Original file line number Diff line number Diff line change @@ -594,10 +594,10 @@ char8_t utf8_str[] = u8"\u0123";
594
594
The `constinit` specifier requires that a variable must be initialized at compile-time.
595
595
```c++
596
596
const char* g() { return "dynamic initialization"; }
597
- constexpr const char* f(bool p ) { return p ? "constant initializer" : g() ; }
597
+ constexpr const char* f() { return "constant initializer"; }
598
598
599
- constinit const char* c = f(true); // OK
600
- constinit const char* d = g(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
599
+ constinit const char* c = f(); // OK
600
+ constinit const char* d = g(); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
601
601
```
602
602
603
603
### \_\_VA\_OPT\_\_
You can’t perform that action at this time.
0 commit comments