gcc/testsuite/g++.dg/cpp2a/consteval-prop20.C
raw| 1 | // P2564R3 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | // { dg-options "-Wno-c++23-extensions" } |
| 4 | |
| 5 | consteval int id(int i) { return i; } |
| 6 | |
| 7 | constexpr int |
| 8 | f (auto i) |
| 9 | { |
| 10 | return id (i); |
| 11 | } |
| 12 | |
| 13 | void |
| 14 | g () |
| 15 | { |
| 16 | auto p = &f<int>; // { dg-error "taking address" } |
| 17 | decltype(&f<int>) x; |
| 18 | if consteval { |
| 19 | auto q = &f<int>; |
| 20 | } |
| 21 | } |