gcc/testsuite/g++.dg/cpp2a/constinit18.C
raw| 1 | // PR c++/104066 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | constinit void (*p)() = nullptr; |
| 5 | constinit void (*pp)() = nullptr; |
| 6 | void fn(); |
| 7 | constinit void (&r)() = fn; |
| 8 | |
| 9 | extern constinit long (* const syscall_reexported) (long, ...); |
| 10 | |
| 11 | constinit void bad (); // { dg-error ".constinit. on function return type is not allowed" } |
| 12 | constinit void bad () { } // { dg-error ".constinit. on function return type is not allowed" } |