Skip to content
Snippets Groups Projects
Commit b91bfb6f authored by Christian Engwer's avatar Christian Engwer
Browse files

add an other cxx0x test

(credits go to Steffen Müthing)

[[Imported from SVN: r6326]]
parent ac532c32
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ ALLM4S = \ ...@@ -16,6 +16,7 @@ ALLM4S = \
cxx0x_nullptr.m4 \ cxx0x_nullptr.m4 \
cxx0x_static_assert.m4 \ cxx0x_static_assert.m4 \
cxx0x_variadic.m4 \ cxx0x_variadic.m4 \
cxx0x_variadic_constructor_sfinae.m4 \
dune.m4 \ dune.m4 \
dune_all.m4 \ dune_all.m4 \
dune_autobuild.m4 \ dune_autobuild.m4 \
......
...@@ -26,7 +26,7 @@ AC_DEFUN([RVALUE_REFERENCES_CHECK],[ ...@@ -26,7 +26,7 @@ AC_DEFUN([RVALUE_REFERENCES_CHECK],[
AC_MSG_RESULT(yes)], [ AC_MSG_RESULT(yes)], [
HAVE_RVALUE_REFERENCES=no HAVE_RVALUE_REFERENCES=no
AC_MSG_RESULT(no)]) AC_MSG_RESULT(no)])
if test "x$HAVE_RVALUe_REFERENCES" = xyes; then if test "x$HAVE_RVALUE_REFERENCES" = xyes; then
AC_DEFINE(HAVE_RVALUE_REFERENCES, 1, [Define to 1 if rvalue references are supported]) AC_DEFINE(HAVE_RVALUE_REFERENCES, 1, [Define to 1 if rvalue references are supported])
fi fi
AC_LANG_POP AC_LANG_POP
......
# tests whether the compiler supports SFINAE on variadic template constructors
# within template classes. GCC 4.3 fails this test.
# the associated macro is called HAVE_VARIADIC_CONSTRUCTOR_SFINAE
AC_DEFUN([VARIADIC_CONSTRUCTOR_SFINAE_CHECK],[
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether SFINAE on variadic template constructors is fully supported])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([#include <cassert>
#include <functional>
template<typename... U>
struct A
{
template<typename... T,
typename = typename std::enable_if<(sizeof...(T) < 2)>::type
>
A(T... t)
: i(1)
{}
template<typename... T,
typename = typename std::enable_if<(sizeof...(T) >= 2)>::type,
typename = void
>
A(T... t)
: i(-1)
{}
A()
: i(1)
{}
int i;
};],
[
assert( A<int>().i +
A<int>(2).i +
A<int>("foo",3.4).i +
A<int>({2,5,6},'a',A<int>()).i == 0);
return 0;
])],[
HAVE_VARIADIC_CONSTRUCTOR_SFINAE=yes
AC_MSG_RESULT(yes)], [
HAVE_VARIADIC_CONSTRUCTOR_SFINAE=no
AC_MSG_RESULT(no)])
if test "x$HAVE_VARIADIC_CONSTRUCTOR_SFINAE" = xyes; then
AC_DEFINE(HAVE_VARIADIC_CONSTRUCTOR_SFINAE, 1, [Define to 1 if SFINAE on variadic template constructors is fully supported])
fi
AC_LANG_POP
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment