|
|
@@ -662,7 +662,7 @@ GCC3DEB
|
|
|
GCC3_CXXFLAGS
|
|
|
GCC3_CFLAGS
|
|
|
CCDEPMODE
|
|
|
-HAVE_CXX14
|
|
|
+HAVE_CXX11
|
|
|
CXXCPP
|
|
|
CC
|
|
|
OBJEXT
|
|
|
@@ -3146,7 +3146,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
|
|
|
|
|
|
|
|
|
|
|
- ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=true
|
|
|
+ ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true
|
|
|
ac_ext=cpp
|
|
|
ac_cpp='$CXXCPP $CPPFLAGS'
|
|
|
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
|
|
@@ -3159,9 +3159,9 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
|
|
if test x$ac_success = xno; then
|
|
|
for alternative in ${ax_cxx_compile_alternatives}; do
|
|
|
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
|
|
|
- cachevar=`$as_echo "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh`
|
|
|
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5
|
|
|
-$as_echo_n "checking whether $CXX supports C++14 features with $switch... " >&6; }
|
|
|
+ cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
|
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
|
|
|
+$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
|
|
|
if eval \${$cachevar+:} false; then :
|
|
|
$as_echo_n "(cached) " >&6
|
|
|
else
|
|
|
@@ -3455,126 +3455,6 @@ namespace cxx11
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-// If the compiler admits that it is not ready for C++14, why torture it?
|
|
|
-// Hopefully, this will speed up the test.
|
|
|
-
|
|
|
-#ifndef __cplusplus
|
|
|
-
|
|
|
-#error "This is not a C++ compiler"
|
|
|
-
|
|
|
-#elif __cplusplus < 201402L
|
|
|
-
|
|
|
-#error "This is not a C++14 compiler"
|
|
|
-
|
|
|
-#else
|
|
|
-
|
|
|
-namespace cxx14
|
|
|
-{
|
|
|
-
|
|
|
- namespace test_polymorphic_lambdas
|
|
|
- {
|
|
|
-
|
|
|
- int
|
|
|
- test()
|
|
|
- {
|
|
|
- const auto lambda = [](auto&&... args){
|
|
|
- const auto istiny = [](auto x){
|
|
|
- return (sizeof(x) == 1UL) ? 1 : 0;
|
|
|
- };
|
|
|
- const int aretiny[] = { istiny(args)... };
|
|
|
- return aretiny[0];
|
|
|
- };
|
|
|
- return lambda(1, 1L, 1.0f, '1');
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- namespace test_binary_literals
|
|
|
- {
|
|
|
-
|
|
|
- constexpr auto ivii = 0b0000000000101010;
|
|
|
- static_assert(ivii == 42, "wrong value");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- namespace test_generalized_constexpr
|
|
|
- {
|
|
|
-
|
|
|
- template < typename CharT >
|
|
|
- constexpr unsigned long
|
|
|
- strlen_c(const CharT *const s) noexcept
|
|
|
- {
|
|
|
- auto length = 0UL;
|
|
|
- for (auto p = s; *p; ++p)
|
|
|
- ++length;
|
|
|
- return length;
|
|
|
- }
|
|
|
-
|
|
|
- static_assert(strlen_c("") == 0UL, "");
|
|
|
- static_assert(strlen_c("x") == 1UL, "");
|
|
|
- static_assert(strlen_c("test") == 4UL, "");
|
|
|
- static_assert(strlen_c("another\0test") == 7UL, "");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- namespace test_lambda_init_capture
|
|
|
- {
|
|
|
-
|
|
|
- int
|
|
|
- test()
|
|
|
- {
|
|
|
- auto x = 0;
|
|
|
- const auto lambda1 = [a = x](int b){ return a + b; };
|
|
|
- const auto lambda2 = [a = lambda1(x)](){ return a; };
|
|
|
- return lambda2();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- namespace test_digit_separators
|
|
|
- {
|
|
|
-
|
|
|
- constexpr auto ten_million = 100'000'000;
|
|
|
- static_assert(ten_million == 100000000, "");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- namespace test_return_type_deduction
|
|
|
- {
|
|
|
-
|
|
|
- auto f(int& x) { return x; }
|
|
|
- decltype(auto) g(int& x) { return x; }
|
|
|
-
|
|
|
- template < typename T1, typename T2 >
|
|
|
- struct is_same
|
|
|
- {
|
|
|
- static constexpr auto value = false;
|
|
|
- };
|
|
|
-
|
|
|
- template < typename T >
|
|
|
- struct is_same<T, T>
|
|
|
- {
|
|
|
- static constexpr auto value = true;
|
|
|
- };
|
|
|
-
|
|
|
- int
|
|
|
- test()
|
|
|
- {
|
|
|
- auto x = 0;
|
|
|
- static_assert(is_same<int, decltype(f(x))>::value, "");
|
|
|
- static_assert(is_same<int&, decltype(g(x))>::value, "");
|
|
|
- return x;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-} // namespace cxx14
|
|
|
-
|
|
|
-#endif // __cplusplus >= 201402L
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
_ACEOF
|
|
|
if ac_fn_cxx_try_compile "$LINENO"; then :
|
|
|
eval $cachevar=yes
|
|
|
@@ -3607,19 +3487,19 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
|
|
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
|
|
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
|
|
|
|
|
- if test x$ax_cxx_compile_cxx14_required = xtrue; then
|
|
|
+ if test x$ax_cxx_compile_cxx11_required = xtrue; then
|
|
|
if test x$ac_success = xno; then
|
|
|
- as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5
|
|
|
+ as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
|
|
|
fi
|
|
|
fi
|
|
|
if test x$ac_success = xno; then
|
|
|
- HAVE_CXX14=0
|
|
|
- { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5
|
|
|
-$as_echo "$as_me: No compiler with C++14 support was found" >&6;}
|
|
|
+ HAVE_CXX11=0
|
|
|
+ { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
|
|
|
+$as_echo "$as_me: No compiler with C++11 support was found" >&6;}
|
|
|
else
|
|
|
- HAVE_CXX14=1
|
|
|
+ HAVE_CXX11=1
|
|
|
|
|
|
-$as_echo "#define HAVE_CXX14 1" >>build/confdefs.h
|
|
|
+$as_echo "#define HAVE_CXX11 1" >>build/confdefs.h
|
|
|
|
|
|
fi
|
|
|
|