summaryrefslogtreecommitdiffstats
path: root/m4macros
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2018-03-08 15:09:37 +0100
committerFrancis Dupont <fdupont@isc.org>2018-03-08 15:09:37 +0100
commitd37958badff741dfaa376c30ac9281eb33d9b44a (patch)
tree733aaca9ccb2d8f8052128bb87eb3e819d99b775 /m4macros
parent[master] Fixed build error under FreeBSD in unit test code (diff)
downloadkea-d37958badff741dfaa376c30ac9281eb33d9b44a.tar.xz
kea-d37958badff741dfaa376c30ac9281eb33d9b44a.zip
[5560] Added enum class and range-for tests
Diffstat (limited to 'm4macros')
-rw-r--r--m4macros/ax_cpp11.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/m4macros/ax_cpp11.m4 b/m4macros/ax_cpp11.m4
index 9f3025ebff..17fbda1809 100644
--- a/m4macros/ax_cpp11.m4
+++ b/m4macros/ax_cpp11.m4
@@ -138,6 +138,35 @@ for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
[AC_MSG_RESULT([no])
continue])
+ AC_MSG_CHECKING(enum class support)
+ feature="enum class"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [enum class FooBar {
+ FOO = 1,
+ BAR = 2
+ };],
+ [FooBar f = FooBar::FOO;
+ return (f == FooBar::FOO ? 1 : 2);])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ continue])
+
+ AC_MSG_CHECKING(range-for support)
+ feature="constexpr"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <vector>
+ std::vector<int> v = { 1, 2, 3, 4 };],
+ [int sum = 0;
+ for (auto i : v) {
+ sum += i;
+ }
+ return sum;])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ continue])
+
AC_MSG_CHECKING(lambda support)
feature="lambda"
AC_COMPILE_IFELSE(