Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/constexpr-if38.C

raw
1 // PR c++/94554
2 // { dg-do compile { target c++17 } }
3 // { dg-additional-options -Wall }
4
5 int meow() { return 1; }
6 void kitty(int);
7 template <int (*F)()>
8 void test() {
9 if constexpr (F) {
10 kitty(F());
11 } else {
12 kitty(2);
13 }
14 }
15 template void test<nullptr>();
16 template void test<meow>();