Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C

raw
1 // { dg-do compile { target c++11 } }
2
3 constexpr bool is_negative(int x) { return x < 0; }
4
5 constexpr bool check(int x, bool (*p)(int)) { return p(x); } // #1
6
7 static_assert(check(-2, is_negative), "Error");