gcc/testsuite/g++.dg/cpp1z/constexpr-if35.C
raw| 1 | // PR c++/101764 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | void g(...); |
| 5 | |
| 6 | template<class> |
| 7 | auto f() { |
| 8 | return [](auto... ts) { |
| 9 | g([] { if constexpr (sizeof(ts)); }...); |
| 10 | #if __cpp_concepts |
| 11 | g(requires { decltype(ts){0}; }...); |
| 12 | #endif |
| 13 | }; |
| 14 | } |
| 15 | |
| 16 | int main() { |
| 17 | f<int>()('a', true); |
| 18 | } |