]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C
call.c (null_ptr_cst_p): Use maybe_constant_value.
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-fnptr.C
1 // { dg-options -std=c++0x }
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");