summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C
new file mode 100644
index 000000000..4c84d827f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-fnptr.C
@@ -0,0 +1,7 @@
+// { dg-options -std=c++0x }
+
+constexpr bool is_negative(int x) { return x < 0; }
+
+constexpr bool check(int x, bool (*p)(int)) { return p(x); } // #1
+
+static_assert(check(-2, is_negative), "Error");