gcc/testsuite/g++.dg/cpp1z/constexpr-if1.C
raw| 1 | // Testcase from P0292R2 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "" } |
| 4 | |
| 5 | template<typename T, typename ... Rest> void g(T&& p, Rest&& ...rs) { |
| 6 | // ... handle p |
| 7 | if constexpr (sizeof...(rs) > 0) // { dg-warning "constexpr" "" { target c++14_down } } |
| 8 | g(rs...); // never instantiated with an empty argument list. |
| 9 | } |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | g(1,2,3); |
| 14 | } |