diff --git a/Makefile.in b/Makefile.in index 15cb3ab4c0..6d16369a4c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -7712,6 +7712,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/configure b/configure index 9e7c0225f8..68b5c9981e 100755 --- a/configure +++ b/configure @@ -1006,6 +1006,8 @@ ACSM_ENABLE_GLIBCXX_DEBUGGING_FALSE ACSM_ENABLE_GLIBCXX_DEBUGGING_TRUE HAVE_CXX11 HAVE_CXX14 +HAVE_CXX17 +HAVE_CXX20 HAVE_CXX11_ALIAS_DECLARATIONS_FALSE HAVE_CXX11_ALIAS_DECLARATIONS_TRUE HAVE_CXX11_VARIADIC_TEMPLATES_FALSE @@ -1050,7 +1052,7 @@ HAVE_CXX11_RANGEFOR_FALSE HAVE_CXX11_RANGEFOR_TRUE HAVE_CXX11_AUTO_FALSE HAVE_CXX11_AUTO_TRUE -HAVE_CXX17 +HAVE_CXX23 PRTDIAG SED am__fastdepCXX_FALSE @@ -9240,9 +9242,9 @@ else case e in #( e) as_fn_error $? "${withval} for --with-cxx-std-min must be an integer >= 2011" "$LINENO" 5 ;; esac fi - if test "$withval" -gt 2017 + if test "$withval" -gt 2023 then : - as_fn_error $? "${withval} for --with-cxx-std-min must be an integer <= 2017" "$LINENO" 5 + as_fn_error $? "${withval} for --with-cxx-std-min must be an integer <= 2023" "$LINENO" 5 fi fi @@ -9283,12 +9285,14 @@ acsm_cxx_version=0 acsm_backup_CXX="$CXX" acsm_backup_CXXCPP="$CXXCPP" - if test 2017 -le "$acsm_CXX_STD_MAX" + + CXX_YEAR=23 + if test "20$CXX_YEAR" -le "$acsm_CXX_STD_MAX" -a $acsm_found_cxx -eq 0 then : - if test 2017 -gt "$acsm_CXX_STD_MIN" + if test "20$CXX_YEAR" -gt "$acsm_CXX_STD_MIN" then : - ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=false + ax_cxx_compile_alternatives="23" ax_cxx_compile_cxx23_required=false ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9296,10 +9300,11 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no - cachevar=ax_cv_cxx_compile_cxx17 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features by default" >&5 -printf %s "checking whether $CXX supports C++17 features by default... " >&6; } -if eval test \${$cachevar+y} + + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++23 features by default" >&5 +printf %s "checking whether $CXX supports C++23 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx23+y} then : printf %s "(cached) " >&6 else case e in #( @@ -9314,7 +9319,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -9601,7 +9620,7 @@ namespace cxx11 #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -9721,7 +9740,7 @@ namespace cxx14 #error "This is not a C++ compiler" -#elif __cplusplus < 201703L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L #error "This is not a C++17 compiler" @@ -10087,42 +10106,103 @@ namespace cxx17 } // namespace cxx17 -#endif // __cplusplus < 201703L +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L + +#error "This is not a C++23 compiler" + +#else + +#include + +namespace cxx23 +{ + +// As C++23 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx23 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - eval $cachevar=yes + ax_cv_cxx_compile_cxx23=yes else case e in #( - e) eval $cachevar=no ;; + e) ax_cv_cxx_compile_cxx23=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes -then : - ac_success=yes -fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx23" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx23" >&6; } + if test x$ax_cv_cxx_compile_cxx23 = xyes; then + ac_success=yes + fi + fi + + + + + if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 -printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx23_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx23_$switch" | sed "$as_sed_sh"` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++23 features with $switch" >&5 +printf %s "checking whether $CXX supports C++23 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10133,7 +10213,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -10420,7 +10514,7 @@ namespace cxx11 #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -10540,7 +10634,7 @@ namespace cxx14 #error "This is not a C++ compiler" -#elif __cplusplus < 201703L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L #error "This is not a C++17 compiler" @@ -10906,7 +11000,59 @@ namespace cxx17 } // namespace cxx17 -#endif // __cplusplus < 201703L +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L + +#error "This is not a C++23 compiler" + +#else + +#include + +namespace cxx23 +{ + +// As C++23 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx23 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L @@ -10919,36 +11065,68 @@ else case e in #( esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; + CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break fi - ac_success=yes + done + if test x$ac_success = xyes; then break fi done fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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_cxx23_required = xtrue; then 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=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 -printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } -if eval test \${$cachevar+y} + as_fn_error $? "*** A compiler with support for C++23 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX23=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++23 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++23 support was found" >&6;} + else + HAVE_CXX23=1 + +printf "%s\n" "#define HAVE_CXX23 1" >>confdefs.h + + fi + + +else case e in #( + e) ax_cxx_compile_alternatives="23" ax_cxx_compile_cxx23_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + ac_success=no + + + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++23 features by default" >&5 +printf %s "checking whether $CXX supports C++23 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx23+y} then : printf %s "(cached) " >&6 else case e in #( - e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10959,7 +11137,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -11246,7 +11438,7 @@ namespace cxx11 #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -11366,7 +11558,7 @@ namespace cxx14 #error "This is not a C++ compiler" -#elif __cplusplus < 201703L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L #error "This is not a C++17 compiler" @@ -11732,79 +11924,103 @@ namespace cxx17 } // namespace cxx17 -#endif // __cplusplus < 201703L +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L + +#error "This is not a C++23 compiler" + +#else + +#include + +namespace cxx23 +{ + +// As C++23 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx23 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - eval $cachevar=yes + ax_cv_cxx_compile_cxx23=yes else case e in #( - e) eval $cachevar=no ;; + e) ax_cv_cxx_compile_cxx23=no ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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_cxx17_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx23" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx23" >&6; } + if test x$ax_cv_cxx_compile_cxx23 = xyes; then + ac_success=yes fi fi - if test x$ac_success = xno; then - HAVE_CXX17=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} - else - HAVE_CXX17=1 -printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h - fi -else case e in #( - e) ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=true - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - ac_success=no - cachevar=ax_cv_cxx_compile_cxx17 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features by default" >&5 -printf %s "checking whether $CXX supports C++17 features by default... " >&6; } + + 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}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx23_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx23_$switch" | sed "$as_sed_sh"` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++23 features with $switch" >&5 +printf %s "checking whether $CXX supports C++23 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext + e) ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11815,7 +12031,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -12102,7 +12332,7 @@ namespace cxx11 #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -12222,7 +12452,7 @@ namespace cxx14 #error "This is not a C++ compiler" -#elif __cplusplus < 201703L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L #error "This is not a C++17 compiler" @@ -12588,1724 +12818,1618 @@ namespace cxx17 } // namespace cxx17 -#endif // __cplusplus < 201703L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval $cachevar=yes -else case e in #( - e) eval $cachevar=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes -then : - ac_success=yes -fi +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 -printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } -if eval test \${$cachevar+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L -#error "This is not a C++11 compiler" +#error "This is not a C++20 compiler" #else -namespace cxx11 +#include + +namespace cxx20 { - namespace test_static_assert - { +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; +} // namespace cxx20 - } +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L - namespace test_final_override - { - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; - } +#ifndef __cplusplus - namespace test_double_right_angle_brackets - { +#error "This is not a C++ compiler" - template < typename T > - struct check {}; +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; +#error "This is not a C++23 compiler" - } +#else - namespace test_decltype - { +#include - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } +namespace cxx23 +{ - } +// As C++23 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. - namespace test_type_deduction - { +} // namespace cxx23 - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202302L - template < typename T > - struct is_same - { - static const bool value = true; - }; - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else case e in #( + e) eval $cachevar=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" ;; +esac +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi - } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_noexcept - { + if test x$ax_cxx_compile_cxx23_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++23 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX23=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++23 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++23 support was found" >&6;} + else + HAVE_CXX23=1 - int f() { return 0; } - int g() noexcept { return 0; } +printf "%s\n" "#define HAVE_CXX23 1" >>confdefs.h - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); + fi - } + ;; +esac +fi + eval "HAVE_TESTED_CXX=\${HAVE_CXX$CXX_YEAR}" + if test "$HAVE_TESTED_CXX" = "1" -a $acsm_found_cxx -eq 0 +then : - namespace test_constexpr - { + # If nothing fails later we're good to go + have_cxx_all=yes - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } + # -------------------------------------------------------------- + # Test for mandatory C++11 features, those which libMesh now requires + # for internal use. + # -------------------------------------------------------------- - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } + have_cxx11_auto=no - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 auto keyword support" >&5 +printf %s "checking for C++11 auto keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - } - namespace test_rvalue_references - { + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - template < int N > - struct answer - { - static constexpr int value = N; - }; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } +int +main (void) +{ - } + int x = 5; + auto y = x; - namespace test_uniform_initialization - { + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - struct test - { - static const int zero {}; - static const int one {1}; - }; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); +printf "%s\n" "#define HAVE_CXX11_AUTO 1" >>confdefs.h - } + have_cxx11_auto=yes - namespace test_lambdas - { +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } + if test x$have_cxx11_auto == xyes; then + HAVE_CXX11_AUTO_TRUE= + HAVE_CXX11_AUTO_FALSE='#' +else + HAVE_CXX11_AUTO_TRUE='#' + HAVE_CXX11_AUTO_FALSE= +fi - } - namespace test_variadic_templates - { + if test "x$have_cxx11_auto" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 auto variable support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 auto variable support" >&2;} + have_cxx_all=no +fi - template - struct sum; - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; + have_cxx11_rangefor=no - template <> - struct sum<> - { - static constexpr auto value = 0; - }; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 range-based for loop support" >&5 +printf %s "checking for C++11 range-based for loop support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - struct foo {}; + #include + #include + void print(const std::vector & v) + { + for (const int & x : v) + std::cout << x << ' '; + std::cout << std::endl; + } - template - using member = typename T::member_type; +int +main (void) +{ - template - void func(...) {} + std::vector v(3); + print(v); - template - void func(member*) {} + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - void test(); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - void test() { func(0); } +printf "%s\n" "#define HAVE_CXX11_RANGEFOR 1" >>confdefs.h - } + have_cxx11_rangefor=yes -} // namespace cxx11 +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -#endif // __cplusplus >= 201103L + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_rangefor == xyes; then + HAVE_CXX11_RANGEFOR_TRUE= + HAVE_CXX11_RANGEFOR_FALSE='#' +else + HAVE_CXX11_RANGEFOR_TRUE='#' + HAVE_CXX11_RANGEFOR_FALSE= +fi -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. + if test "x$have_cxx11_rangefor" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 ranged-for loop support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 ranged-for loop support" >&2;} + have_cxx_all=no +fi -#ifndef __cplusplus + # Technically we require uniform initialization, but this is the + # closest test we have -#error "This is not a C++ compiler" + have_cxx11_initializer_list=no -#elif __cplusplus < 201402L + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 initializer list support" >&5 +printf %s "checking for C++11 initializer list support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 -#error "This is not a C++14 compiler" -#else + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" -namespace cxx14 -{ + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - namespace test_polymorphic_lambdas - { + #include + #include + #include - 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'); - } +int +main (void) +{ - } + std::vector v = { "xyzzy", "plugh", "abracadabra" }; - namespace test_binary_literals - { + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - } +printf "%s\n" "#define HAVE_CXX11_INITIALIZER_LIST 1" >>confdefs.h - namespace test_generalized_constexpr - { + have_cxx11_initializer_list=yes - 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; - } +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - } - namespace test_lambda_init_capture - { + if test x$have_cxx11_initializer_list == xyes; then + HAVE_CXX11_INITIALIZER_LIST_TRUE= + HAVE_CXX11_INITIALIZER_LIST_FALSE='#' +else + HAVE_CXX11_INITIALIZER_LIST_TRUE='#' + HAVE_CXX11_INITIALIZER_LIST_FALSE= +fi - 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(); - } - } + if test "x$have_cxx11_initializer_list" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 initializer list support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 initializer list support" >&2;} + have_cxx_all=no +fi - namespace test_digit_separators - { - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); + have_cxx11_unique_ptr=no - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::unique_ptr support" >&5 +printf %s "checking for C++11 std::unique_ptr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_return_type_deduction - { - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template < typename T > - struct is_same + #include + #include + struct Foo { - static constexpr auto value = true; + Foo() { std::cout << "Foo::Foo\n"; } + ~Foo() { std::cout << "Foo::~Foo\n"; } }; - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L +int +main (void) +{ + { + // up now owns a Foo + std::unique_ptr up(new Foo); + } // Foo deleted when up goes out of scope + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -// If the compiler admits that it is not ready for C++17, why torture it? -// Hopefully, this will speed up the test. +printf "%s\n" "#define HAVE_CXX11_UNIQUE_PTR 1" >>confdefs.h -#ifndef __cplusplus + have_cxx11_unique_ptr=yes -#error "This is not a C++ compiler" +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -#elif __cplusplus < 201703L + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 -#error "This is not a C++17 compiler" -#else + if test x$have_cxx11_unique_ptr == xyes; then + HAVE_CXX11_UNIQUE_PTR_TRUE= + HAVE_CXX11_UNIQUE_PTR_FALSE='#' +else + HAVE_CXX11_UNIQUE_PTR_TRUE='#' + HAVE_CXX11_UNIQUE_PTR_FALSE= +fi -#include -#include -#include -namespace cxx17 -{ + if test "x$have_cxx11_unique_ptr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::unique_ptr support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::unique_ptr support" >&2;} + have_cxx_all=no +fi - namespace test_constexpr_lambdas - { - constexpr int foo = [](){return 42;}(); + have_cxx11_make_unique_workaround=no - } + # This is a simple workaround for no std::make_unique in C++11: + # http://stackoverflow.com/questions/7038357/make-unique-and-perfect-forwarding + # Requires working rvalue references, std::forward, variadic + # templates, and std::unique_ptr from C++11. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::make_unique workaround support" >&5 +printf %s "checking for C++11 std::make_unique workaround support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test::nested_namespace::definitions - { - } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - namespace test_fold_expression - { + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template - int multiply(Args... args) + #include + namespace local { - return (args * ... * 1); + template + std::unique_ptr make_unique(Args&&... args) + { + return std::unique_ptr(new T(std::forward(args)...)); + } } - template - bool all(Args... args) +int +main (void) +{ + { - return (args && ...); - } + // Normally, you would use "auto" on the LHS here to avoid + // repeating the type name, but we are not testing auto here. + std::unique_ptr up = local::make_unique(42); + } // Foo deleted when up goes out of scope - } + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - namespace test_extended_static_assert - { + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - static_assert (true); +printf "%s\n" "#define HAVE_CXX11_MAKE_UNIQUE_WORKAROUND 1" >>confdefs.h - } + have_cxx11_make_unique_workaround=yes - namespace test_auto_brace_init_list - { +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - auto foo = {5}; - auto bar {5}; + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - static_assert(std::is_same, decltype(foo)>::value); - static_assert(std::is_same::value); - } - namespace test_typename_in_template_template_parameter - { + if test x$have_cxx11_make_unique_workaround == xyes; then + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE= + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE='#' +else + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE='#' + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE= +fi - template typename X> struct D; - } + if test "x$have_cxx11_make_unique_workaround" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 variadic template support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 variadic template support" >&2;} + have_cxx_all=no +fi - namespace test_fallthrough_nodiscard_maybe_unused_attributes - { - int f1() - { - return 42; - } + have_cxx11_tuple=no - [[nodiscard]] int f2() - { - [[maybe_unused]] auto unused = f1(); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::tuple support" >&5 +printf %s "checking for C++11 std::tuple support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - switch (f1()) - { - case 17: - f1(); - [[fallthrough]]; - case 42: - f1(); - } - return f1(); - } - } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - namespace test_extended_aggregate_initialization - { + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - struct base1 - { - int b1, b2 = 42; - }; + #include + #include + #include - struct base2 - { - base2() { - b3 = 42; - } - int b3; - }; +int +main (void) +{ - struct derived : base1, base2 - { - int d; - }; + // Test std::make_tuple + std::map> students; + students[0] = std::make_tuple(3.8, 'A', "Lisa Simpson"); + students[1] = std::make_tuple(2.9, 'C', "Milhouse Van Houten"); - derived d1 {{1, 2}, {}, 4}; // full initialization - derived d2 {{}, {}, 4}; // value-initialized bases + // Test templated std::get() method. + std::get<0>(students[0]); + std::get<1>(students[0]); + std::get<2>(students[0]); - } + // Test std::tie and std::ignore which are declared in the header. + double gpa1; + std::string name1; + std::tie(gpa1, std::ignore, name1) = students[1]; - namespace test_general_range_based_for_loop - { + // Test std::tuple_cat(), which combines together one or more + // objects, not necessarily tuples, into a single tuple. + auto t = std::tuple_cat(students[0], students[1], std::make_pair("foo", 42)); - struct iter - { - int i; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - int& operator* () - { - return i; - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - const int& operator* () const - { - return i; - } +printf "%s\n" "#define HAVE_CXX11_TUPLE 1" >>confdefs.h - iter& operator++() - { - ++i; - return *this; - } - }; + have_cxx11_tuple=yes - struct sentinel - { - int i; - }; +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - bool operator== (const iter& i, const sentinel& s) - { - return i.i == s.i; - } + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - bool operator!= (const iter& i, const sentinel& s) - { - return !(i == s); - } - struct range - { - iter begin() const - { - return {0}; - } + if test x$have_cxx11_tuple == xyes; then + HAVE_CXX11_TUPLE_TRUE= + HAVE_CXX11_TUPLE_FALSE='#' +else + HAVE_CXX11_TUPLE_TRUE='#' + HAVE_CXX11_TUPLE_FALSE= +fi - sentinel end() const - { - return {5}; - } - }; - void f() - { - range r {}; + if test "x$have_cxx11_tuple" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::tuple support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::tuple support" >&2;} + have_cxx_all=no +fi - for (auto i : r) - { - [[maybe_unused]] auto v = i; - } - } - } + have_cxx11_lambda=no - namespace test_lambda_capture_asterisk_this_by_value - { + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 lambda support" >&5 +printf %s "checking for C++11 lambda support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - struct t - { - int i; - int foo() - { - return [*this]() - { - return i; - }(); - } - }; - } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - namespace test_enum_class_construction - { + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - enum class byte : unsigned char - {}; + // typedef for a function pointer that takes int and returns bool. + typedef bool (*FunctionPointer) (int); - byte foo {42}; + // A function that takes a pointer to a function that takes an int, + // calls it with the number 4, and returns the result. + bool f(FunctionPointer g) { return g(4); } - } +int +main (void) +{ - namespace test_constexpr_if - { + // Call f, passing it a lambda constructed on the fly instead + // of a standard function pointer. The result should be true. + f ( [](int x) { return x > 3; } ); - template - int f () - { - if constexpr(cond) - { - return 13; - } - else - { - return 42; - } - } + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - namespace test_selection_statement_with_initializer - { +printf "%s\n" "#define HAVE_CXX11_LAMBDA 1" >>confdefs.h - int f() - { - return 13; - } + have_cxx11_lambda=yes - int f2() - { - if (auto i = f(); i > 0) - { - return 3; - } +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - switch (auto i = f(); i + 4) - { - case 17: - return 2; + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - default: - return 1; - } - } - } + if test x$have_cxx11_lambda == xyes; then + HAVE_CXX11_LAMBDA_TRUE= + HAVE_CXX11_LAMBDA_FALSE='#' +else + HAVE_CXX11_LAMBDA_TRUE='#' + HAVE_CXX11_LAMBDA_FALSE= +fi - namespace test_template_argument_deduction_for_class_templates - { - template - struct pair - { - pair (T1 p1, T2 p2) - : m1 {p1}, - m2 {p2} - {} + if test "x$have_cxx11_lambda" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 lambda support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 lambda support" >&2;} + have_cxx_all=no +fi - T1 m1; - T2 m2; - }; - void f() - { - [[maybe_unused]] auto p = pair{13, 42u}; - } + have_cxx11_fixed_type_enum=no - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 fixed type enumeration support" >&5 +printf %s "checking for C++11 fixed type enumeration support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_non_type_auto_template_parameters - { - template - struct B - {}; + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - B<5> b1; - B<'a'> b2; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - } + enum Fruit : int {APPLE=0, ORANGE=1}; - namespace test_structured_bindings - { +int +main (void) +{ - int arr[2] = { 1, 2 }; - std::pair pr = { 1, 2 }; + Fruit f = APPLE; - auto f1() -> int(&)[2] - { - return arr; - } + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - auto f2() -> std::pair& - { - return pr; - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - struct S - { - int x1 : 2; - volatile double y1; - }; +printf "%s\n" "#define HAVE_CXX11_FIXED_TYPE_ENUM 1" >>confdefs.h - S f3() - { - return {}; - } + have_cxx11_fixed_type_enum=yes - auto [ x1, y1 ] = f1(); - auto& [ xr1, yr1 ] = f1(); - auto [ x2, y2 ] = f2(); - auto& [ xr2, yr2 ] = f2(); - const auto [ x3, y3 ] = f3(); +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_exception_spec_type_system - { - struct Good {}; - struct Bad {}; + if test x$have_cxx11_fixed_type_enum == xyes; then + HAVE_CXX11_FIXED_TYPE_ENUM_TRUE= + HAVE_CXX11_FIXED_TYPE_ENUM_FALSE='#' +else + HAVE_CXX11_FIXED_TYPE_ENUM_TRUE='#' + HAVE_CXX11_FIXED_TYPE_ENUM_FALSE= +fi - void g1() noexcept; - void g2(); - template - Bad - f(T*, T*); + if test "x$have_cxx11_fixed_type_enum" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 fixed type enumeration support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 fixed type enumeration support" >&2;} + have_cxx_all=no +fi - template - Good - f(T1*, T2*); - static_assert (std::is_same_v); + have_cxx11_fixed_type_enum_fwd=no - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 fixed type enumeration forward declaration support" >&5 +printf %s "checking for C++11 fixed type enumeration forward declaration support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_inline_variables - { - template void f(T) - {} + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - template inline T g(T) - { - return T{}; - } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template<> inline void f<>(int) - {} + #include + enum Foo : int; + void func(Foo f) { std::cout << f << std::endl; } + enum Foo : int { FOO0 = 0, FOO1 = 1, FOO2 = 2 }; - template<> int g<>(int) - { - return 5; - } +int +main (void) +{ - } + func(FOO0); + func(FOO1); + func(FOO2); -} // namespace cxx17 + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : -#endif // __cplusplus < 201703L + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +printf "%s\n" "#define HAVE_CXX11_FIXED_TYPE_ENUM_FWD 1" >>confdefs.h + have_cxx11_fixed_type_enum_fwd=yes -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval $cachevar=yes else case e in #( - e) eval $cachevar=no ;; + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; -esac -fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi - 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=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 -printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } -if eval test \${$cachevar+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. + if test x$have_cxx11_fixed_type_enum_fwd == xyes; then + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE= + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE='#' +else + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE='#' + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE= +fi -#ifndef __cplusplus -#error "This is not a C++ compiler" + if test "x$have_cxx11_fixed_type_enum_fwd" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 fixed type enumeration forward declaration support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 fixed type enumeration forward declaration support" >&2;} + have_cxx_all=no +fi -#elif __cplusplus < 201103L -#error "This is not a C++11 compiler" + have_cxx11_override=no -#else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 override keyword support" >&5 +printf %s "checking for C++11 override keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 -namespace cxx11 -{ - namespace test_static_assert - { + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - } - namespace test_final_override - { +int +main (void) +{ - struct Base - { - virtual ~Base() {} + struct Base { virtual void f() {} - }; - - struct Derived : public Base - { - virtual ~Derived() override {} + }; + struct Child : public Base { virtual void f() override {} - }; - - } + }; - namespace test_double_right_angle_brackets - { + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - template < typename T > - struct check {}; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; +printf "%s\n" "#define HAVE_CXX11_OVERRIDE 1" >>confdefs.h - } + have_cxx11_override=yes - namespace test_decltype - { +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - template < typename T > - struct is_same - { - static const bool value = true; - }; + if test x$have_cxx11_override == xyes; then + HAVE_CXX11_OVERRIDE_TRUE= + HAVE_CXX11_OVERRIDE_FALSE='#' +else + HAVE_CXX11_OVERRIDE_TRUE='#' + HAVE_CXX11_OVERRIDE_FALSE= +fi - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } + if test "x$have_cxx11_override" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 compiler support the override keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 compiler support the override keyword" >&2;} + have_cxx_all=no +fi - } - namespace test_noexcept - { + have_cxx11_move_constructors=no - int f() { return 0; } - int g() noexcept { return 0; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 move constructor support" >&5 +printf %s "checking for C++11 move constructor support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - namespace test_constexpr - { + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + #include + class move_constructable_base { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept + public: + move_constructable_base() {} + move_constructable_base(move_constructable_base && other) noexcept {} + }; + class move_constructable : public move_constructable_base { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + public: + move_constructable() {} + move_constructable(move_constructable && other) noexcept : move_constructable_base(std::move(other)) {} + }; - } +int +main (void) +{ - namespace test_rvalue_references - { + move_constructable m1; + move_constructable m2(std::move(m1)); - template < int N > - struct answer - { - static constexpr int value = N; - }; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } +printf "%s\n" "#define HAVE_CXX11_MOVE_CONSTRUCTORS 1" >>confdefs.h - } + have_cxx11_move_constructors=yes - namespace test_uniform_initialization - { +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - struct test - { - static const int zero {}; - static const int one {1}; - }; + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - } + if test x$have_cxx11_move_constructors == xyes; then + HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE= + HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE='#' +else + HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE='#' + HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE= +fi - namespace test_lambdas - { - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } + if test "x$have_cxx11_move_constructors" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 move constructor support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 move constructor support" >&2;} + have_cxx_all=no +fi - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } + have_cxx11_deleted_functions=no - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 deleted functions support" >&5 +printf %s "checking for C++11 deleted functions support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_variadic_templates - { - template - struct sum; + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template <> - struct sum<> + class Foo { - static constexpr auto value = 0; + Foo(const Foo &) = delete; }; - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { +int +main (void) +{ - struct foo {}; - template - using member = typename T::member_type; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - template - void func(...) {} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - template - void func(member*) {} +printf "%s\n" "#define HAVE_CXX11_DELETED_FUNCTIONS 1" >>confdefs.h - void test(); + have_cxx11_deleted_functions=yes - void test() { func(0); } +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 -} // namespace cxx11 -#endif // __cplusplus >= 201103L + if test x$have_cxx11_deleted_functions == xyes; then + HAVE_CXX11_DELETED_FUNCTIONS_TRUE= + HAVE_CXX11_DELETED_FUNCTIONS_FALSE='#' +else + HAVE_CXX11_DELETED_FUNCTIONS_TRUE='#' + HAVE_CXX11_DELETED_FUNCTIONS_FALSE= +fi + if test "x$have_cxx11_deleted_functions" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 deleted function support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 deleted function support" >&2;} + have_cxx_all=no +fi -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. + have_cxx11_defaulted_functions=no -#ifndef __cplusplus + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 defaulted functions support" >&5 +printf %s "checking for C++11 defaulted functions support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 -#error "This is not a C++ compiler" -#elif __cplusplus < 201402L + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" -#error "This is not a C++14 compiler" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -#else + class Foo + { + Foo(const Foo &) = default; + ~Foo(); + }; + Foo::~Foo() = default; -namespace cxx14 +int +main (void) { - 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'); - } + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - namespace test_binary_literals - { +printf "%s\n" "#define HAVE_CXX11_DEFAULTED_FUNCTIONS 1" >>confdefs.h - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); + have_cxx11_defaulted_functions=yes - } +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - namespace test_generalized_constexpr - { + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - 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, ""); + if test x$have_cxx11_defaulted_functions == xyes; then + HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE= + HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE='#' +else + HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE='#' + HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE= +fi - } - namespace test_lambda_init_capture - { + if test "x$have_cxx11_defaulted_functions" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 defaulted function support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 defaulted function support" >&2;} + have_cxx_all=no +fi - 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(); - } - } + have_cxx11_nullptr=no - namespace test_digit_separators - { + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 nullptr support" >&5 +printf %s "checking for C++11 nullptr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - namespace test_return_type_deduction - { + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } + #include + void f(int * pi) {} + void f(double * pd) {} + void f(std::nullptr_t nullp) {} - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; +int +main (void) +{ - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; + // would be ambiguous without void f(nullptr_t) + f(nullptr); - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -} // namespace cxx14 +printf "%s\n" "#define HAVE_CXX11_NULLPTR 1" >>confdefs.h -#endif // __cplusplus >= 201402L + have_cxx11_nullptr=yes +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 the compiler admits that it is not ready for C++17, why torture it? -// Hopefully, this will speed up the test. + if test x$have_cxx11_nullptr == xyes; then + HAVE_CXX11_NULLPTR_TRUE= + HAVE_CXX11_NULLPTR_FALSE='#' +else + HAVE_CXX11_NULLPTR_TRUE='#' + HAVE_CXX11_NULLPTR_FALSE= +fi -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201703L - -#error "This is not a C++17 compiler" - -#else -#include -#include -#include - -namespace cxx17 -{ + if test "x$have_cxx11_nullptr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 nullptr keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 nullptr keyword" >&2;} + have_cxx_all=no +fi - namespace test_constexpr_lambdas - { - constexpr int foo = [](){return 42;}(); + have_cxx11_final=no - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 'final' keyword support" >&5 +printf %s "checking for C++11 'final' keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test::nested_namespace::definitions - { - } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - namespace test_fold_expression - { + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template - int multiply(Args... args) + // Test that a function can be declared final. + struct A { - return (args * ... * 1); - } + virtual void foo() final; + }; - template - bool all(Args... args) + // Test that a struct can be declared final. + struct B final : A { - return (args && ...); - } + }; - } +int +main (void) +{ - namespace test_extended_static_assert - { - static_assert (true); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - } + have_cxx11_final=yes - namespace test_auto_brace_init_list - { +else case e in #( + e) + have_cxx11_final=no + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - auto foo = {5}; - auto bar {5}; + # Confirm that you cannot declare a non-virtual function 'final'. + if test "x$have_cxx11_final" != "xno" +then : - static_assert(std::is_same, decltype(foo)>::value); - static_assert(std::is_same::value); - } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - namespace test_typename_in_template_template_parameter - { + struct A + { + // Error: non-virtual function cannot be final + void bar() final; + }; - template typename X> struct D; +int +main (void) +{ - } - namespace test_fallthrough_nodiscard_maybe_unused_attributes - { + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - int f1() - { - return 42; - } + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no - [[nodiscard]] int f2() - { - [[maybe_unused]] auto unused = f1(); +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - switch (f1()) - { - case 17: - f1(); - [[fallthrough]]; - case 42: - f1(); - } - return f1(); - } +fi - } + if test "x$have_cxx11_final" != "xno" +then : - namespace test_extended_aggregate_initialization - { + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - struct base1 - { - int b1, b2 = 42; - }; + struct A + { + virtual void foo() final; + }; + struct B : A + { + // Error: foo cannot be overridden as it's final in A + void foo(); + }; - struct base2 - { - base2() { - b3 = 42; - } - int b3; - }; +int +main (void) +{ - struct derived : base1, base2 - { - int d; - }; - derived d1 {{1, 2}, {}, 4}; // full initialization - derived d2 {{}, {}, 4}; // value-initialized bases + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - } + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no - namespace test_general_range_based_for_loop - { +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - struct iter - { - int i; +fi - int& operator* () - { - return i; - } + if test "x$have_cxx11_final" != "xno" +then : - const int& operator* () const - { - return i; - } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - iter& operator++() - { - ++i; - return *this; - } - }; + struct A + { + }; - struct sentinel - { - int i; - }; + // struct B is final + struct B final : A + { + }; - bool operator== (const iter& i, const sentinel& s) - { - return i.i == s.i; - } + // Error: B is final + struct C : B + { + }; - bool operator!= (const iter& i, const sentinel& s) - { - return !(i == s); - } +int +main (void) +{ - struct range - { - iter begin() const - { - return {0}; - } - sentinel end() const - { - return {5}; - } - }; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - void f() - { - range r {}; + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no - for (auto i : r) - { - [[maybe_unused]] auto v = i; - } - } +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } +fi - namespace test_lambda_capture_asterisk_this_by_value - { + # If the flag is still 'yes' after all the tests, set the #define. + if test "x$have_cxx11_final" = "xyes" +then : - struct t - { - int i; - int foo() - { - return [*this]() - { - return i; - }(); - } - }; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - } +printf "%s\n" "#define HAVE_CXX11_FINAL 1" >>confdefs.h - namespace test_enum_class_construction - { - enum class byte : unsigned char - {}; +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac +fi - byte foo {42}; + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - } - namespace test_constexpr_if - { + if test x$have_cxx11_final == xyes; then + HAVE_CXX11_FINAL_TRUE= + HAVE_CXX11_FINAL_FALSE='#' +else + HAVE_CXX11_FINAL_TRUE='#' + HAVE_CXX11_FINAL_FALSE= +fi - template - int f () - { - if constexpr(cond) - { - return 13; - } - else - { - return 42; - } - } - } + if test "x$have_cxx11_final" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 final keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 final keyword" >&2;} + have_cxx_all=no +fi - namespace test_selection_statement_with_initializer - { - int f() - { - return 13; - } + have_cxx11_decltype=no - int f2() - { - if (auto i = f(); i > 0) - { - return 3; - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 decltype support" >&5 +printf %s "checking for C++11 decltype support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - switch (auto i = f(); i + 4) - { - case 17: - return 2; - default: - return 1; - } - } + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - namespace test_template_argument_deduction_for_class_templates - { + #include - template - struct pair - { - pair (T1 p1, T2 p2) - : m1 {p1}, - m2 {p2} - {} +int +main (void) +{ - T1 m1; - T2 m2; - }; + int a; + decltype(a) b; + std::vector vec(10); + for (auto i = decltype(vec.size())(0); i < vec.size(); ++i) + vec[i] += i; - void f() - { - [[maybe_unused]] auto p = pair{13, 42u}; - } + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - namespace test_non_type_auto_template_parameters - { +printf "%s\n" "#define HAVE_CXX11_DECLTYPE 1" >>confdefs.h - template - struct B - {}; + have_cxx11_decltype=yes - B<5> b1; - B<'a'> b2; +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_structured_bindings - { - int arr[2] = { 1, 2 }; - std::pair pr = { 1, 2 }; + if test x$have_cxx11_decltype == xyes; then + HAVE_CXX11_DECLTYPE_TRUE= + HAVE_CXX11_DECLTYPE_FALSE='#' +else + HAVE_CXX11_DECLTYPE_TRUE='#' + HAVE_CXX11_DECLTYPE_FALSE= +fi - auto f1() -> int(&)[2] - { - return arr; - } - auto f2() -> std::pair& - { - return pr; - } + if test "x$have_cxx11_decltype" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 decltype keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 decltype keyword" >&2;} + have_cxx_all=no +fi - struct S - { - int x1 : 2; - volatile double y1; - }; - S f3() - { - return {}; - } + have_cxx11_begin_end=no - auto [ x1, y1 ] = f1(); - auto& [ xr1, yr1 ] = f1(); - auto [ x2, y2 ] = f2(); - auto& [ xr2, yr2 ] = f2(); - const auto [ x3, y3 ] = f3(); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::begin/end support for arrays" >&5 +printf %s "checking for C++11 std::begin/end support for arrays... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - } - namespace test_exception_spec_type_system - { + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - struct Good {}; - struct Bad {}; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - void g1() noexcept; - void g2(); + #include + #include - template - Bad - f(T*, T*); +int +main (void) +{ - template - Good - f(T1*, T2*); - - static_assert (std::is_same_v); - - } - - namespace test_inline_variables - { - - template void f(T) - {} - - template inline T g(T) - { - return T{}; - } - - template<> inline void f<>(int) - {} - - template<> int g<>(int) - { - return 5; - } - - } - -} // namespace cxx17 - -#endif // __cplusplus < 201703L + int array[5] = {3, 1, 5, 2, 4}; + std::sort(std::begin(array), std::end(array)); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_begin_end=yes -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval $cachevar=yes else case e in #( - e) eval $cachevar=no ;; + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; -esac -fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' 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_cxx17_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 - fi - fi - if test x$ac_success = xno; then - HAVE_CXX17=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} - else - HAVE_CXX17=1 - -printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h - - fi - ;; -esac -fi - if test "$HAVE_CXX17" = "1" -a $acsm_found_cxx -eq 0 + if test "x$have_cxx11_begin_end" != "xyes" then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::begin/end support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::begin/end support" >&2;} + have_cxx_all=no +fi - # If nothing fails later we're good to go - have_cxx_all=yes - - # -------------------------------------------------------------- - # Test for mandatory C++11 features, those which libMesh now requires - # for internal use. - # -------------------------------------------------------------- - have_cxx11_auto=no + have_cxx11_container_erase=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 auto keyword support" >&5 -printf %s "checking for C++11 auto keyword support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std container erase() functions returning iterators" >&5 +printf %s "checking for C++11 std container erase() functions returning iterators... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14319,13 +14443,33 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include + #include int main (void) { - int x = 5; - auto y = x; + { + std::map m; + m.insert(std::make_pair(1,2)); + std::map::iterator it = m.erase(m.begin()); + } + { + std::set s; + s.insert(1); + std::set::iterator it = s.erase(s.begin()); + } + { + std::multimap m; + m.insert(std::make_pair(1,2)); + std::multimap::iterator it = m.erase(m.begin()); + } + { + std::multiset s; + s.insert(1); + std::multiset::iterator it = s.erase(s.begin()); + } ; return 0; @@ -14336,10 +14480,7 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_AUTO 1" >>confdefs.h - - have_cxx11_auto=yes + have_cxx11_container_erase=yes else case e in #( e) @@ -14350,8 +14491,7 @@ esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14359,27 +14499,18 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_auto == xyes; then - HAVE_CXX11_AUTO_TRUE= - HAVE_CXX11_AUTO_FALSE='#' -else - HAVE_CXX11_AUTO_TRUE='#' - HAVE_CXX11_AUTO_FALSE= -fi - - - if test "x$have_cxx11_auto" != "xyes" + if test "x$have_cxx11_container_erase" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 auto variable support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 auto variable support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std container erase() functions returning iterators" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std container erase() functions returning iterators" >&2;} have_cxx_all=no fi - have_cxx11_rangefor=no + have_cxx11_container_emplace=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 range-based for loop support" >&5 -printf %s "checking for C++11 range-based for loop support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std container emplace() functions" >&5 +printf %s "checking for C++11 std container emplace() functions... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14393,21 +14524,39 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - void print(const std::vector & v) - { - for (const int & x : v) - std::cout << x << ' '; - std::cout << std::endl; - } + #include + #include + #include int main (void) { - std::vector v(3); - print(v); + { + std::map m; + m.emplace(1,2); + m.emplace_hint(m.begin(), 0, 3); + } + { + std::set s; + s.emplace(1); + s.emplace_hint(s.begin(), 0); + } + { + std::multimap m; + m.emplace(1,2); + m.emplace_hint(m.begin(), 0, 3); + } + { + std::multiset s; + s.emplace(1); + s.emplace_hint(s.begin(), 0); + } + { + std::vector v; + v.emplace(v.begin(), 0); + v.emplace_back(1); + } ; return 0; @@ -14418,10 +14567,7 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_RANGEFOR 1" >>confdefs.h - - have_cxx11_rangefor=yes + have_cxx11_container_emplace=yes else case e in #( e) @@ -14432,8 +14578,7 @@ esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14441,29 +14586,18 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_rangefor == xyes; then - HAVE_CXX11_RANGEFOR_TRUE= - HAVE_CXX11_RANGEFOR_FALSE='#' -else - HAVE_CXX11_RANGEFOR_TRUE='#' - HAVE_CXX11_RANGEFOR_FALSE= -fi - - - if test "x$have_cxx11_rangefor" != "xyes" + if test "x$have_cxx11_container_emplace" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 ranged-for loop support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 ranged-for loop support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std container emplace() functions" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std container emplace() functions" >&2;} have_cxx_all=no fi - # Technically we require uniform initialization, but this is the - # closest test we have - have_cxx11_initializer_list=no + have_cxx11_iota=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 initializer list support" >&5 -printf %s "checking for C++11 initializer list support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::iota algorithm" >&5 +printf %s "checking for C++11 std::iota algorithm... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14477,15 +14611,15 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include + #include + #include int main (void) { - std::vector v = { "xyzzy", "plugh", "abracadabra" }; + std::vector v(10); + std::iota(v.begin(), v.end(), 0); ; return 0; @@ -14496,22 +14630,18 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_INITIALIZER_LIST 1" >>confdefs.h - - have_cxx11_initializer_list=yes + have_cxx11_iota=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14519,27 +14649,18 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_initializer_list == xyes; then - HAVE_CXX11_INITIALIZER_LIST_TRUE= - HAVE_CXX11_INITIALIZER_LIST_FALSE='#' -else - HAVE_CXX11_INITIALIZER_LIST_TRUE='#' - HAVE_CXX11_INITIALIZER_LIST_FALSE= -fi - - - if test "x$have_cxx11_initializer_list" != "xyes" + if test "x$have_cxx11_iota" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 initializer list support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 initializer list support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::iota" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::iota" >&2;} have_cxx_all=no fi - have_cxx11_unique_ptr=no + have_cxx11_vector_data=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::unique_ptr support" >&5 -printf %s "checking for C++11 std::unique_ptr support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::vector::data() API" >&5 +printf %s "checking for C++11 std::vector::data() API... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14553,22 +14674,14 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - struct Foo - { - Foo() { std::cout << "Foo::Foo\n"; } - ~Foo() { std::cout << "Foo::~Foo\n"; } - }; + #include int main (void) { - { - // up now owns a Foo - std::unique_ptr up(new Foo); - } // Foo deleted when up goes out of scope + std::vector v(10); + int * begin = v.data(); ; return 0; @@ -14579,22 +14692,18 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_UNIQUE_PTR 1" >>confdefs.h - - have_cxx11_unique_ptr=yes + have_cxx11_vector_data=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14602,31 +14711,18 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_unique_ptr == xyes; then - HAVE_CXX11_UNIQUE_PTR_TRUE= - HAVE_CXX11_UNIQUE_PTR_FALSE='#' -else - HAVE_CXX11_UNIQUE_PTR_TRUE='#' - HAVE_CXX11_UNIQUE_PTR_FALSE= -fi - - - if test "x$have_cxx11_unique_ptr" != "xyes" + if test "x$have_cxx11_vector_data" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::unique_ptr support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::unique_ptr support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::vector::data()" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::vector::data()" >&2;} have_cxx_all=no fi - have_cxx11_make_unique_workaround=no + have_cxx11_shared_ptr=no - # This is a simple workaround for no std::make_unique in C++11: - # http://stackoverflow.com/questions/7038357/make-unique-and-perfect-forwarding - # Requires working rvalue references, std::forward, variadic - # templates, and std::unique_ptr from C++11. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::make_unique workaround support" >&5 -printf %s "checking for C++11 std::make_unique workaround support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::shared_ptr support" >&5 +printf %s "checking for C++11 std::shared_ptr support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14634,6 +14730,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + # Save any original value that CXXFLAGS had old_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" @@ -14641,24 +14738,16 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu /* end confdefs.h. */ #include - namespace local - { - template - std::unique_ptr make_unique(Args&&... args) - { - return std::unique_ptr(new T(std::forward(args)...)); - } - } int main (void) { - { - // Normally, you would use "auto" on the LHS here to avoid - // repeating the type name, but we are not testing auto here. - std::unique_ptr up = local::make_unique(42); - } // Foo deleted when up goes out of scope + std::shared_ptr p1; + std::shared_ptr p2 (new int); + std::shared_ptr p3 (p2); + p3.reset(new int); + p3 = std::make_shared(5); ; return 0; @@ -14667,22 +14756,27 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : + have_cxx11_shared_ptr=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -printf "%s\n" "#define HAVE_CXX11_MAKE_UNIQUE_WORKAROUND 1" >>confdefs.h - - have_cxx11_make_unique_workaround=yes - else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + have_cxx11_shared_ptr=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test "x$have_cxx11_shared_ptr" = "xyes" +then : + +printf "%s\n" "#define HAVE_CXX11_SHARED_PTR 1" >>confdefs.h + +fi + # Reset the flags CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp @@ -14692,27 +14786,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_make_unique_workaround == xyes; then - HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE= - HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE='#' + if test x$have_cxx11_shared_ptr == xyes; then + HAVE_CXX11_SHARED_PTR_TRUE= + HAVE_CXX11_SHARED_PTR_FALSE='#' else - HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE='#' - HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE= + HAVE_CXX11_SHARED_PTR_TRUE='#' + HAVE_CXX11_SHARED_PTR_FALSE= fi - if test "x$have_cxx11_make_unique_workaround" != "xyes" + if test "x$have_cxx11_shared_ptr" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 variadic template support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 variadic template support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::shared_ptr" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::shared_ptr" >&2;} have_cxx_all=no fi - have_cxx11_tuple=no + have_cxx11_rvalue_references=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::tuple support" >&5 -printf %s "checking for C++11 std::tuple support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 rvalue references support" >&5 +printf %s "checking for C++11 rvalue references support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14720,38 +14814,21 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - old_CXXFLAGS="$CXXFLAGS" + old_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include + int foo(int && x) { return x; } + int bar() { return 4; } int main (void) { - // Test std::make_tuple - std::map> students; - students[0] = std::make_tuple(3.8, 'A', "Lisa Simpson"); - students[1] = std::make_tuple(2.9, 'C', "Milhouse Van Houten"); - - // Test templated std::get() method. - std::get<0>(students[0]); - std::get<1>(students[0]); - std::get<2>(students[0]); - - // Test std::tie and std::ignore which are declared in the header. - double gpa1; - std::string name1; - std::tie(gpa1, std::ignore, name1) = students[1]; - - // Test std::tuple_cat(), which combines together one or more - // objects, not necessarily tuples, into a single tuple. - auto t = std::tuple_cat(students[0], students[1], std::make_pair("foo", 42)); + // Call function that takes an rvalue reference. + foo (bar()); ; return 0; @@ -14763,9 +14840,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -printf "%s\n" "#define HAVE_CXX11_TUPLE 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX11_RVALUE_REFERENCES 1" >>confdefs.h - have_cxx11_tuple=yes + have_cxx11_rvalue_references=yes else case e in #( e) @@ -14776,7 +14853,8 @@ esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS="$old_CXXFLAGS" + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14784,27 +14862,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_tuple == xyes; then - HAVE_CXX11_TUPLE_TRUE= - HAVE_CXX11_TUPLE_FALSE='#' + if test x$have_cxx11_rvalue_references == xyes; then + HAVE_CXX11_RVALUE_REFERENCES_TRUE= + HAVE_CXX11_RVALUE_REFERENCES_FALSE='#' else - HAVE_CXX11_TUPLE_TRUE='#' - HAVE_CXX11_TUPLE_FALSE= + HAVE_CXX11_RVALUE_REFERENCES_TRUE='#' + HAVE_CXX11_RVALUE_REFERENCES_FALSE= fi - if test "x$have_cxx11_tuple" != "xyes" + if test "x$have_cxx11_rvalue_references" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::tuple support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::tuple support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for rvalue references" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for rvalue references" >&2;} have_cxx_all=no fi - have_cxx11_lambda=no + have_cxx11_to_string=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 lambda support" >&5 -printf %s "checking for C++11 lambda support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::to_string() support" >&5 +printf %s "checking for C++11 std::to_string() support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14818,20 +14896,22 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - // typedef for a function pointer that takes int and returns bool. - typedef bool (*FunctionPointer) (int); - - // A function that takes a pointer to a function that takes an int, - // calls it with the number 4, and returns the result. - bool f(FunctionPointer g) { return g(4); } + #include int main (void) { - // Call f, passing it a lambda constructed on the fly instead - // of a standard function pointer. The result should be true. - f ( [](int x) { return x > 3; } ); + // tiny="0.000000". Note: std::to_string(double) is required to produce + // a std::string with the same contents as std::sprintf(buf, "%f", value) + // would produce, given a sufficiently large buf. This is *different* from + // what you get from a std::stringstream using default formatting and + // precision flags, i.e. + // std::ostringstream oss; + // oss << 1.e-40; + // std::string tiny = oss.str(); + // will produce the string "1e-40". + std::string tiny = std::to_string(1.e-40); ; return 0; @@ -14843,13 +14923,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -printf "%s\n" "#define HAVE_CXX11_LAMBDA 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX11_TO_STRING 1" >>confdefs.h - have_cxx11_lambda=yes + have_cxx11_to_string=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac @@ -14865,27 +14945,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_lambda == xyes; then - HAVE_CXX11_LAMBDA_TRUE= - HAVE_CXX11_LAMBDA_FALSE='#' + if test x$have_cxx11_to_string == xyes; then + HAVE_CXX11_TO_STRING_TRUE= + HAVE_CXX11_TO_STRING_FALSE='#' else - HAVE_CXX11_LAMBDA_TRUE='#' - HAVE_CXX11_LAMBDA_FALSE= + HAVE_CXX11_TO_STRING_TRUE='#' + HAVE_CXX11_TO_STRING_FALSE= fi - if test "x$have_cxx11_lambda" != "xyes" + if test "x$have_cxx11_to_string" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 lambda support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 lambda support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::to_string()" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::to_string()" >&2;} have_cxx_all=no fi - have_cxx11_fixed_type_enum=no + have_cxx11_constexpr=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 fixed type enumeration support" >&5 -printf %s "checking for C++11 fixed type enumeration support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 constexpr support" >&5 +printf %s "checking for C++11 constexpr support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14893,19 +14973,20 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - old_CXXFLAGS="$CXXFLAGS" + old_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - enum Fruit : int {APPLE=0, ORANGE=1}; + constexpr int multiply (int x, int y) { return x * y; } int main (void) { - Fruit f = APPLE; + // The compiler should compute "val" at compile time. + const int val = multiply(10, 10); ; return 0; @@ -14917,9 +14998,9 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -printf "%s\n" "#define HAVE_CXX11_FIXED_TYPE_ENUM 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX11_CONSTEXPR 1" >>confdefs.h - have_cxx11_fixed_type_enum=yes + have_cxx11_constexpr=yes else case e in #( e) @@ -14930,7 +15011,8 @@ esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS="$old_CXXFLAGS" + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14938,27 +15020,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_fixed_type_enum == xyes; then - HAVE_CXX11_FIXED_TYPE_ENUM_TRUE= - HAVE_CXX11_FIXED_TYPE_ENUM_FALSE='#' + if test x$have_cxx11_constexpr == xyes; then + HAVE_CXX11_CONSTEXPR_TRUE= + HAVE_CXX11_CONSTEXPR_FALSE='#' else - HAVE_CXX11_FIXED_TYPE_ENUM_TRUE='#' - HAVE_CXX11_FIXED_TYPE_ENUM_FALSE= + HAVE_CXX11_CONSTEXPR_TRUE='#' + HAVE_CXX11_CONSTEXPR_FALSE= fi - if test "x$have_cxx11_fixed_type_enum" != "xyes" + if test "x$have_cxx11_constexpr" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 fixed type enumeration support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 fixed type enumeration support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for constexpr" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for constexpr" >&2;} have_cxx_all=no fi - have_cxx11_fixed_type_enum_fwd=no + have_cxx11_variadic_templates=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 fixed type enumeration forward declaration support" >&5 -printf %s "checking for C++11 fixed type enumeration forward declaration support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 variadic template support" >&5 +printf %s "checking for C++11 variadic template support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14972,18 +15054,23 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - enum Foo : int; - void func(Foo f) { std::cout << f << std::endl; } - enum Foo : int { FOO0 = 0, FOO1 = 1, FOO2 = 2 }; + // Base case + template + T sum(T t) { return t; } -int + // Compute sum of arbitrary number of passed parameters. + template + T sum(T t, P ...p) + { + t += sum(p...); + return t; + } + +int main (void) { - func(FOO0); - func(FOO1); - func(FOO2); + sum(1, 2, 3, 4, 5); ; return 0; @@ -14995,20 +15082,21 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -printf "%s\n" "#define HAVE_CXX11_FIXED_TYPE_ENUM_FWD 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX11_VARIADIC_TEMPLATES 1" >>confdefs.h - have_cxx11_fixed_type_enum_fwd=yes + have_cxx11_variadic_templates=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS="$old_CXXFLAGS" + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15016,27 +15104,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_fixed_type_enum_fwd == xyes; then - HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE= - HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE='#' + if test x$have_cxx11_variadic_templates == xyes; then + HAVE_CXX11_VARIADIC_TEMPLATES_TRUE= + HAVE_CXX11_VARIADIC_TEMPLATES_FALSE='#' else - HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE='#' - HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE= + HAVE_CXX11_VARIADIC_TEMPLATES_TRUE='#' + HAVE_CXX11_VARIADIC_TEMPLATES_FALSE= fi - if test "x$have_cxx11_fixed_type_enum_fwd" != "xyes" + if test "x$have_cxx11_variadic_templates" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 fixed type enumeration forward declaration support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 fixed type enumeration forward declaration support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for variadic templates" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for variadic templates" >&2;} have_cxx_all=no fi - have_cxx11_override=no + have_cxx11_alias_declarations=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 override keyword support" >&5 -printf %s "checking for C++11 override keyword support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 alias declarations support" >&5 +printf %s "checking for C++11 alias declarations support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15050,17 +15138,21 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + template + struct check + { + T t; + }; + + // An alias declaration is like a templated typedef + template + using MyCheck = check; int main (void) { - struct Base { - virtual void f() {} - }; - struct Child : public Base { - virtual void f() override {} - }; + MyCheck mc; ; return 0; @@ -15072,13 +15164,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -printf "%s\n" "#define HAVE_CXX11_OVERRIDE 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX11_ALIAS_DECLARATIONS 1" >>confdefs.h - have_cxx11_override=yes + have_cxx11_alias_declarations=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac @@ -15094,27 +15186,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_override == xyes; then - HAVE_CXX11_OVERRIDE_TRUE= - HAVE_CXX11_OVERRIDE_FALSE='#' + if test x$have_cxx11_alias_declarations == xyes; then + HAVE_CXX11_ALIAS_DECLARATIONS_TRUE= + HAVE_CXX11_ALIAS_DECLARATIONS_FALSE='#' else - HAVE_CXX11_OVERRIDE_TRUE='#' - HAVE_CXX11_OVERRIDE_FALSE= + HAVE_CXX11_ALIAS_DECLARATIONS_TRUE='#' + HAVE_CXX11_ALIAS_DECLARATIONS_FALSE= fi - if test "x$have_cxx11_override" != "xyes" + if test "x$have_cxx11_alias_declarations" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 compiler support the override keyword" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 compiler support the override keyword" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for alias declarations" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for alias declarations" >&2;} have_cxx_all=no fi - have_cxx11_move_constructors=no + have_cxx11_array=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 move constructor support" >&5 -printf %s "checking for C++11 move constructor support... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::array" >&5 +printf %s "checking for C++11 std::array... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15128,26 +15220,15 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - class move_constructable_base - { - public: - move_constructable_base() {} - move_constructable_base(move_constructable_base && other) noexcept {} - }; - class move_constructable : public move_constructable_base - { - public: - move_constructable() {} - move_constructable(move_constructable && other) noexcept : move_constructable_base(std::move(other)) {} - }; + #include int main (void) { - move_constructable m1; - move_constructable m2(std::move(m1)); + std::array a; + a[0] = 42.0; + double * begin = a.data(); ; return 0; @@ -15158,10 +15239,7 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_MOVE_CONSTRUCTORS 1" >>confdefs.h - - have_cxx11_move_constructors=yes + have_cxx11_array=yes else case e in #( e) @@ -15172,8 +15250,7 @@ esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15181,27 +15258,17 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_move_constructors == xyes; then - HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE= - HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE='#' -else - HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE='#' - HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE= -fi - - - if test "x$have_cxx11_move_constructors" != "xyes" + if test "x$have_cxx11_array" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 move constructor support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 move constructor support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::array" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::array" >&2;} have_cxx_all=no fi - have_cxx11_deleted_functions=no + have_cxx11_isnan=no + have_cxx11_isinf=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 deleted functions support" >&5 -printf %s "checking for C++11 deleted functions support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15212,18 +15279,19 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu old_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isnan" >&5 +printf %s "checking for C++11 std::isnan... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - class Foo - { - Foo(const Foo &) = delete; - }; + #include int main (void) { + if (std::isnan(0.0)) + return 1; ; return 0; @@ -15234,74 +15302,30 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_DELETED_FUNCTIONS 1" >>confdefs.h - - have_cxx11_deleted_functions=yes + have_cxx11_isnan=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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$have_cxx11_deleted_functions == xyes; then - HAVE_CXX11_DELETED_FUNCTIONS_TRUE= - HAVE_CXX11_DELETED_FUNCTIONS_FALSE='#' -else - HAVE_CXX11_DELETED_FUNCTIONS_TRUE='#' - HAVE_CXX11_DELETED_FUNCTIONS_FALSE= -fi - - - if test "x$have_cxx11_deleted_functions" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 deleted function support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 deleted function support" >&2;} - have_cxx_all=no -fi - - - have_cxx11_defaulted_functions=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 defaulted functions support" >&5 -printf %s "checking for C++11 defaulted functions support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - - - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isinf" >&5 +printf %s "checking for C++11 std::isinf... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - class Foo - { - Foo(const Foo &) = default; - ~Foo(); - }; - Foo::~Foo() = default; + #include int main (void) { + if (std::isinf(0.0)) + return 1; ; return 0; @@ -15312,22 +15336,18 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_DEFAULTED_FUNCTIONS 1" >>confdefs.h - - have_cxx11_defaulted_functions=yes + have_cxx11_isinf=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15335,27 +15355,22 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_defaulted_functions == xyes; then - HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE= - HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE='#' -else - HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE='#' - HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE= + if test "x$have_cxx11_isnan" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isnan" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isnan" >&2;} + have_cxx_all=no fi - - - if test "x$have_cxx11_defaulted_functions" != "xyes" + if test "x$have_cxx11_isinf" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 defaulted function support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 defaulted function support" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isinf" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isinf" >&2;} have_cxx_all=no fi - have_cxx11_nullptr=no + have_cxx17_splicing=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 nullptr support" >&5 -printf %s "checking for C++11 nullptr support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15366,20 +15381,28 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu old_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 std::*::merge" >&5 +printf %s "checking for C++17 std::*::merge... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - void f(int * pi) {} - void f(double * pd) {} - void f(std::nullptr_t nullp) {} + #include + #include + #include + #include int main (void) { - // would be ambiguous without void f(nullptr_t) - f(nullptr); + std::set s1{1}, s2{2}; + std::unordered_set us1{3}, us2{4}; + std::map m1{{5,6}}, m2{{7,8}}; + std::unordered_map um1{{9,10}}, um2{{11,12}}; + s1.merge(std::move(s2)); + us1.merge(std::move(us2)); + m1.merge(std::move(m2)); + um1.merge(std::move(um2)); ; return 0; @@ -15388,24 +15411,23 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } + have_cxx17_splicing=yes -printf "%s\n" "#define HAVE_CXX11_NULLPTR 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX17_SPLICING 1" >>confdefs.h - have_cxx11_nullptr=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15413,1846 +15435,1751 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$have_cxx11_nullptr == xyes; then - HAVE_CXX11_NULLPTR_TRUE= - HAVE_CXX11_NULLPTR_FALSE='#' -else - HAVE_CXX11_NULLPTR_TRUE='#' - HAVE_CXX11_NULLPTR_FALSE= + if test "x$have_cxx17_splicing" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh prefers C++17 support for set/map merge" >&5 +printf "%s\n" "$as_me: WARNING: libMesh prefers C++17 support for set/map merge" >&2;} fi +fi + if test "$HAVE_TESTED_CXX" = "1" -a "x$have_cxx_all" = xyes +then : - if test "x$have_cxx11_nullptr" != "xyes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Found C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Found C++$CXX_YEAR standard support" >&6;} + if test $acsm_found_cxx -eq 0 then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 nullptr keyword" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 nullptr keyword" >&2;} - have_cxx_all=no + acsm_cxx_version=$CXX_YEAR +fi + acsm_found_cxx=1 +else case e in #( + e) CXX="$acsm_backup_CXX" + CXXCPP="$acsm_backup_CXXCPP" + if test "$HAVE_CXX17" = "0" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Did not find C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Did not find C++$CXX_YEAR standard support" >&6;} +fi ;; +esac fi +fi - have_cxx11_final=no + CXX_YEAR=20 + if test "20$CXX_YEAR" -le "$acsm_CXX_STD_MAX" -a $acsm_found_cxx -eq 0 +then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 'final' keyword support" >&5 -printf %s "checking for C++11 'final' keyword support... " >&6; } - ac_ext=cpp + if test "20$CXX_YEAR" -gt "$acsm_CXX_STD_MIN" +then : + ax_cxx_compile_alternatives="20" ax_cxx_compile_cxx20_required=false + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' 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 + ac_success=no - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++20 features by default" >&5 +printf %s "checking whether $CXX supports C++20 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx20+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - // Test that a function can be declared final. - struct A - { - virtual void foo() final; - }; - // Test that a struct can be declared final. - struct B final : A - { - }; +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. -int -main (void) -{ +#ifndef __cplusplus +#error "This is not a C++ compiler" - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER - have_cxx11_final=yes +#error "This is not a C++11 compiler" -else case e in #( - e) - have_cxx11_final=no - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +#else - # Confirm that you cannot declare a non-virtual function 'final'. - if test "x$have_cxx11_final" != "xno" -then : +namespace cxx11 +{ - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + namespace test_static_assert + { - struct A - { - // Error: non-virtual function cannot be final - void bar() final; - }; + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; -int -main (void) -{ + } + namespace test_final_override + { - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; - # If this code compiles, 'final' is not working correctly. - have_cxx11_final=no + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; -else case e in #( - e) - have_cxx11_final=yes - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + } -fi + namespace test_double_right_angle_brackets + { - if test "x$have_cxx11_final" != "xno" -then : + template < typename T > + struct check {}; - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; - struct A - { - virtual void foo() final; - }; - struct B : A - { - // Error: foo cannot be overridden as it's final in A - void foo(); - }; + } -int -main (void) -{ + namespace test_decltype + { + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + } - # If this code compiles, 'final' is not working correctly. - have_cxx11_final=no + namespace test_type_deduction + { -else case e in #( - e) - have_cxx11_final=yes - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; -fi + template < typename T > + struct is_same + { + static const bool value = true; + }; - if test "x$have_cxx11_final" != "xno" -then : + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } - struct A - { - }; + } - // struct B is final - struct B final : A - { - }; + namespace test_noexcept + { - // Error: B is final - struct C : B - { - }; + int f() { return 0; } + int g() noexcept { return 0; } -int -main (void) -{ + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + namespace test_constexpr + { - # If this code compiles, 'final' is not working correctly. - have_cxx11_final=no + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } -else case e in #( - e) - have_cxx11_final=yes - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } -fi + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); - # If the flag is still 'yes' after all the tests, set the #define. - if test "x$have_cxx11_final" = "xyes" -then : + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + namespace test_rvalue_references + { -printf "%s\n" "#define HAVE_CXX11_FINAL 1" >>confdefs.h + template < int N > + struct answer + { + static constexpr int value = N; + }; + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } -else case e in #( - e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } ;; -esac -fi + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + } + namespace test_uniform_initialization + { - if test x$have_cxx11_final == xyes; then - HAVE_CXX11_FINAL_TRUE= - HAVE_CXX11_FINAL_FALSE='#' -else - HAVE_CXX11_FINAL_TRUE='#' - HAVE_CXX11_FINAL_FALSE= -fi + struct test + { + static const int zero {}; + static const int one {1}; + }; + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); - if test "x$have_cxx11_final" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 final keyword" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 final keyword" >&2;} - have_cxx_all=no -fi + } + namespace test_lambdas + { - have_cxx11_decltype=no + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 decltype support" >&5 -printf %s "checking for C++11 decltype support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + namespace test_variadic_templates + { - #include + template + struct sum; -int -main (void) -{ + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; - int a; - decltype(a) b; - std::vector vec(10); - for (auto i = decltype(vec.size())(0); i < vec.size(); ++i) - vec[i] += i; + template <> + struct sum<> + { + static constexpr auto value = 0; + }; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + } -printf "%s\n" "#define HAVE_CXX11_DECLTYPE 1" >>confdefs.h + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { - have_cxx11_decltype=yes + struct foo {}; -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + template + using member = typename T::member_type; - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + template + void func(...) {} + template + void func(member*) {} - if test x$have_cxx11_decltype == xyes; then - HAVE_CXX11_DECLTYPE_TRUE= - HAVE_CXX11_DECLTYPE_FALSE='#' -else - HAVE_CXX11_DECLTYPE_TRUE='#' - HAVE_CXX11_DECLTYPE_FALSE= -fi + void test(); + void test() { func(0); } - if test "x$have_cxx11_decltype" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 decltype keyword" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 decltype keyword" >&2;} - have_cxx_all=no -fi + } +} // namespace cxx11 - have_cxx11_begin_end=no +#endif // __cplusplus >= 201103L - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::begin/end support for arrays" >&5 -printf %s "checking for C++11 std::begin/end support for arrays... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. - #include - #include +#ifndef __cplusplus -int -main (void) -{ +#error "This is not a C++ compiler" - int array[5] = {3, 1, 5, 2, 4}; - std::sort(std::begin(array), std::end(array)); +#elif __cplusplus < 201402L && !defined _MSC_VER - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : +#error "This is not a C++14 compiler" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_begin_end=yes +#else -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +namespace cxx14 +{ - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + 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'); + } - if test "x$have_cxx11_begin_end" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::begin/end support" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::begin/end support" >&2;} - have_cxx_all=no -fi + } + namespace test_binary_literals + { - have_cxx11_container_erase=no + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std container erase() functions returning iterators" >&5 -printf %s "checking for C++11 std container erase() functions returning iterators... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + } + namespace test_generalized_constexpr + { - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + 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; + } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); - #include - #include + } -int -main (void) -{ + namespace test_lambda_init_capture + { + int + test() { - std::map m; - m.insert(std::make_pair(1,2)); - std::map::iterator it = m.erase(m.begin()); + 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 { - std::set s; - s.insert(1); - std::set::iterator it = s.erase(s.begin()); - } + static constexpr auto value = false; + }; + + template < typename T > + struct is_same { - std::multimap m; - m.insert(std::make_pair(1,2)); - std::multimap::iterator it = m.erase(m.begin()); - } + static constexpr auto value = true; + }; + + int + test() { - std::multiset s; - s.insert(1); - std::multiset::iterator it = s.erase(s.begin()); + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_container_erase=yes +} // namespace cxx14 -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +#endif // __cplusplus >= 201402L - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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$have_cxx11_container_erase" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std container erase() functions returning iterators" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std container erase() functions returning iterators" >&2;} - have_cxx_all=no -fi +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. - have_cxx11_container_emplace=no +#ifndef __cplusplus - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std container emplace() functions" >&5 -printf %s "checking for C++11 std container emplace() functions... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 +#error "This is not a C++ compiler" +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" +#error "This is not a C++17 compiler" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#else - #include - #include - #include +#include +#include +#include -int -main (void) +namespace cxx17 { + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) { - std::map m; - m.emplace(1,2); - m.emplace_hint(m.begin(), 0, 3); - } - { - std::set s; - s.emplace(1); - s.emplace_hint(s.begin(), 0); - } - { - std::multimap m; - m.emplace(1,2); - m.emplace_hint(m.begin(), 0, 3); - } - { - std::multiset s; - s.emplace(1); - s.emplace_hint(s.begin(), 0); + return (args * ... * 1); } + + template + bool all(Args... args) { - std::vector v; - v.emplace(v.begin(), 0); - v.emplace_back(1); + return (args && ...); } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_container_emplace=yes + namespace test_extended_static_assert + { -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + static_assert (true); - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + } + namespace test_auto_brace_init_list + { - if test "x$have_cxx11_container_emplace" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std container emplace() functions" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std container emplace() functions" >&2;} - have_cxx_all=no -fi + auto foo = {5}; + auto bar {5}; + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } - have_cxx11_iota=no + namespace test_typename_in_template_template_parameter + { - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::iota algorithm" >&5 -printf %s "checking for C++11 std::iota algorithm... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + template typename X> struct D; + } - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + int f1() + { + return 42; + } - #include - #include + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); -int -main (void) -{ + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } - std::vector v(10); - std::iota(v.begin(), v.end(), 0); + } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + namespace test_extended_aggregate_initialization + { - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_iota=yes + struct base1 + { + int b1, b2 = 42; + }; -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + struct derived : base1, base2 + { + int d; + }; + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases - if test "x$have_cxx11_iota" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::iota" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::iota" >&2;} - have_cxx_all=no -fi + } + namespace test_general_range_based_for_loop + { - have_cxx11_vector_data=no + struct iter + { + int i; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::vector::data() API" >&5 -printf %s "checking for C++11 std::vector::data() API... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + int& operator* () + { + return i; + } + const int& operator* () const + { + return i; + } - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + iter& operator++() + { + ++i; + return *this; + } + }; - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + struct sentinel + { + int i; + }; - #include + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } -int -main (void) -{ + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } - std::vector v(10); - int * begin = v.data(); + struct range + { + iter begin() const + { + return {0}; + } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + sentinel end() const + { + return {5}; + } + }; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_vector_data=yes + void f() + { + range r {}; -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + } + namespace test_lambda_capture_asterisk_this_by_value + { - if test "x$have_cxx11_vector_data" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::vector::data()" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::vector::data()" >&2;} - have_cxx_all=no -fi + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + } - have_cxx11_shared_ptr=no + namespace test_enum_class_construction + { - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::shared_ptr support" >&5 -printf %s "checking for C++11 std::shared_ptr support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + enum class byte : unsigned char + {}; + byte foo {42}; - # Save any original value that CXXFLAGS had - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + namespace test_constexpr_if + { - #include + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } -int -main (void) -{ + } - std::shared_ptr p1; - std::shared_ptr p2 (new int); - std::shared_ptr p3 (p2); - p3.reset(new int); - p3 = std::make_shared(5); + namespace test_selection_statement_with_initializer + { - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + int f() + { + return 13; + } - have_cxx11_shared_ptr=yes - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } -else case e in #( - e) - have_cxx11_shared_ptr=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + switch (auto i = f(); i + 4) + { + case 17: + return 2; - if test "x$have_cxx11_shared_ptr" = "xyes" -then : + default: + return 1; + } + } -printf "%s\n" "#define HAVE_CXX11_SHARED_PTR 1" >>confdefs.h + } -fi + namespace test_template_argument_deduction_for_class_templates + { - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + T1 m1; + T2 m2; + }; - if test x$have_cxx11_shared_ptr == xyes; then - HAVE_CXX11_SHARED_PTR_TRUE= - HAVE_CXX11_SHARED_PTR_FALSE='#' -else - HAVE_CXX11_SHARED_PTR_TRUE='#' - HAVE_CXX11_SHARED_PTR_FALSE= -fi + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + } - if test "x$have_cxx11_shared_ptr" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::shared_ptr" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::shared_ptr" >&2;} - have_cxx_all=no -fi + namespace test_non_type_auto_template_parameters + { + template + struct B + {}; - have_cxx11_rvalue_references=no + B<5> b1; + B<'a'> b2; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 rvalue references support" >&5 -printf %s "checking for C++11 rvalue references support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + } + namespace test_structured_bindings + { - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + auto f1() -> int(&)[2] + { + return arr; + } - int foo(int && x) { return x; } - int bar() { return 4; } + auto f2() -> std::pair& + { + return pr; + } -int -main (void) -{ + struct S + { + int x1 : 2; + volatile double y1; + }; - // Call function that takes an rvalue reference. - foo (bar()); + S f3() + { + return {}; + } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + } -printf "%s\n" "#define HAVE_CXX11_RVALUE_REFERENCES 1" >>confdefs.h + namespace test_exception_spec_type_system + { - have_cxx11_rvalue_references=yes + struct Good {}; + struct Bad {}; -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + void g1() noexcept; + void g2(); - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + template + Bad + f(T*, T*); + template + Good + f(T1*, T2*); - if test x$have_cxx11_rvalue_references == xyes; then - HAVE_CXX11_RVALUE_REFERENCES_TRUE= - HAVE_CXX11_RVALUE_REFERENCES_FALSE='#' -else - HAVE_CXX11_RVALUE_REFERENCES_TRUE='#' - HAVE_CXX11_RVALUE_REFERENCES_FALSE= -fi + static_assert (std::is_same_v); + } - if test "x$have_cxx11_rvalue_references" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for rvalue references" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for rvalue references" >&2;} - have_cxx_all=no -fi + namespace test_inline_variables + { + template void f(T) + {} - have_cxx11_to_string=no + template inline T g(T) + { + return T{}; + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::to_string() support" >&5 -printf %s "checking for C++11 std::to_string() support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + template<> inline void f<>(int) + {} + template<> int g<>(int) + { + return 5; + } - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +} // namespace cxx17 - #include +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L -int -main (void) -{ - // tiny="0.000000". Note: std::to_string(double) is required to produce - // a std::string with the same contents as std::sprintf(buf, "%f", value) - // would produce, given a sufficiently large buf. This is *different* from - // what you get from a std::stringstream using default formatting and - // precision flags, i.e. - // std::ostringstream oss; - // oss << 1.e-40; - // std::string tiny = oss.str(); - // will produce the string "1e-40". - std::string tiny = std::to_string(1.e-40); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +#ifndef __cplusplus -printf "%s\n" "#define HAVE_CXX11_TO_STRING 1" >>confdefs.h +#error "This is not a C++ compiler" - have_cxx11_to_string=yes +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +#error "This is not a C++20 compiler" - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 +#else +#include - if test x$have_cxx11_to_string == xyes; then - HAVE_CXX11_TO_STRING_TRUE= - HAVE_CXX11_TO_STRING_FALSE='#' -else - HAVE_CXX11_TO_STRING_TRUE='#' - HAVE_CXX11_TO_STRING_FALSE= -fi +namespace cxx20 +{ +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. - if test "x$have_cxx11_to_string" != "xyes" +} // namespace cxx20 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::to_string()" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::to_string()" >&2;} - have_cxx_all=no + ax_cv_cxx_compile_cxx20=yes +else case e in #( + e) ax_cv_cxx_compile_cxx20=no ;; +esac fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx20" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx20" >&6; } + if test x$ax_cv_cxx_compile_cxx20 = xyes; then + ac_success=yes + fi + fi - have_cxx11_constexpr=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 constexpr support" >&5 -printf %s "checking for C++11 constexpr support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + 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}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx20_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx20_$switch" | sed "$as_sed_sh"` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++20 features with $switch" >&5 +printf %s "checking whether $CXX supports C++20 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - constexpr int multiply (int x, int y) { return x * y; } -int -main (void) -{ +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. - // The compiler should compute "val" at compile time. - const int val = multiply(10, 10); +#ifndef __cplusplus - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : +#error "This is not a C++ compiler" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER -printf "%s\n" "#define HAVE_CXX11_CONSTEXPR 1" >>confdefs.h +#error "This is not a C++11 compiler" - have_cxx11_constexpr=yes +#else -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +namespace cxx11 +{ - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + namespace test_static_assert + { + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; - if test x$have_cxx11_constexpr == xyes; then - HAVE_CXX11_CONSTEXPR_TRUE= - HAVE_CXX11_CONSTEXPR_FALSE='#' -else - HAVE_CXX11_CONSTEXPR_TRUE='#' - HAVE_CXX11_CONSTEXPR_FALSE= -fi + } + namespace test_final_override + { - if test "x$have_cxx11_constexpr" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for constexpr" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for constexpr" >&2;} - have_cxx_all=no -fi + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; - have_cxx11_variadic_templates=no + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 variadic template support" >&5 -printf %s "checking for C++11 variadic template support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + namespace test_double_right_angle_brackets + { + template < typename T > + struct check {}; - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + } - // Base case - template - T sum(T t) { return t; } + namespace test_decltype + { - // Compute sum of arbitrary number of passed parameters. - template - T sum(T t, P ...p) - { - t += sum(p...); - return t; - } + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } -int -main (void) -{ + } - sum(1, 2, 3, 4, 5); + namespace test_type_deduction + { - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + template < typename T > + struct is_same + { + static const bool value = true; + }; -printf "%s\n" "#define HAVE_CXX11_VARIADIC_TEMPLATES 1" >>confdefs.h + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } - have_cxx11_variadic_templates=yes + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + } - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + namespace test_noexcept + { + int f() { return 0; } + int g() noexcept { return 0; } - if test x$have_cxx11_variadic_templates == xyes; then - HAVE_CXX11_VARIADIC_TEMPLATES_TRUE= - HAVE_CXX11_VARIADIC_TEMPLATES_FALSE='#' -else - HAVE_CXX11_VARIADIC_TEMPLATES_TRUE='#' - HAVE_CXX11_VARIADIC_TEMPLATES_FALSE= -fi + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + } - if test "x$have_cxx11_variadic_templates" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for variadic templates" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for variadic templates" >&2;} - have_cxx_all=no -fi + namespace test_constexpr + { + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } - have_cxx11_alias_declarations=no + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 alias declarations support" >&5 -printf %s "checking for C++11 alias declarations support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + } - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + namespace test_rvalue_references + { - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + template < int N > + struct answer + { + static constexpr int value = N; + }; - template - struct check - { - T t; - }; + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } - // An alias declaration is like a templated typedef - template - using MyCheck = check; + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } -int -main (void) -{ + } - MyCheck mc; + namespace test_uniform_initialization + { - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + struct test + { + static const int zero {}; + static const int one {1}; + }; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); -printf "%s\n" "#define HAVE_CXX11_ALIAS_DECLARATIONS 1" >>confdefs.h + } - have_cxx11_alias_declarations=yes + namespace test_lambdas + { -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } - if test x$have_cxx11_alias_declarations == xyes; then - HAVE_CXX11_ALIAS_DECLARATIONS_TRUE= - HAVE_CXX11_ALIAS_DECLARATIONS_FALSE='#' -else - HAVE_CXX11_ALIAS_DECLARATIONS_TRUE='#' - HAVE_CXX11_ALIAS_DECLARATIONS_FALSE= -fi + } + namespace test_variadic_templates + { - if test "x$have_cxx11_alias_declarations" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for alias declarations" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for alias declarations" >&2;} - have_cxx_all=no -fi + template + struct sum; + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; - have_cxx11_array=no + template <> + struct sum<> + { + static constexpr auto value = 0; + }; - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::array" >&5 -printf %s "checking for C++11 std::array... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + } - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + struct foo {}; - #include + template + using member = typename T::member_type; -int -main (void) -{ + template + void func(...) {} - std::array a; - a[0] = 42.0; - double * begin = a.data(); + template + void func(member*) {} - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + void test(); - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_array=yes + void test() { func(0); } -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + } - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 +} // namespace cxx11 +#endif // __cplusplus >= 201103L - if test "x$have_cxx11_array" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::array" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::array" >&2;} - have_cxx_all=no -fi - have_cxx11_isnan=no - have_cxx11_isinf=no - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. +#ifndef __cplusplus - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" +#error "This is not a C++ compiler" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isnan" >&5 -printf %s "checking for C++11 std::isnan... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#elif __cplusplus < 201402L && !defined _MSC_VER - #include +#error "This is not a C++14 compiler" -int -main (void) -{ - - if (std::isnan(0.0)) - return 1; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_isnan=yes - -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isinf" >&5 -printf %s "checking for C++11 std::isinf... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include +#else -int -main (void) +namespace cxx14 { - if (std::isinf(0.0)) - return 1; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_isinf=yes - -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + 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'); + } - if test "x$have_cxx11_isnan" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isnan" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isnan" >&2;} - have_cxx_all=no -fi - if test "x$have_cxx11_isinf" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isinf" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isinf" >&2;} - have_cxx_all=no -fi + } + namespace test_binary_literals + { - have_cxx17_splicing=no + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + } + namespace test_generalized_constexpr + { - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + 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; + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 std::*::merge" >&5 -printf %s "checking for C++17 std::*::merge... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); - #include - #include - #include - #include + } -int -main (void) -{ + namespace test_lambda_init_capture + { - std::set s1{1}, s2{2}; - std::unordered_set us1{3}, us2{4}; - std::map m1{{5,6}}, m2{{7,8}}; - std::unordered_map um1{{9,10}}, um2{{11,12}}; - s1.merge(std::move(s2)); - us1.merge(std::move(us2)); - m1.merge(std::move(m2)); - um1.merge(std::move(um2)); + 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(); + } - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx17_splicing=yes + namespace test_digit_separators + { -printf "%s\n" "#define HAVE_CXX17_SPLICING 1" >>confdefs.h + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + } -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + namespace test_return_type_deduction + { - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 + 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; + }; - if test "x$have_cxx17_splicing" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh prefers C++17 support for set/map merge" >&5 -printf "%s\n" "$as_me: WARNING: libMesh prefers C++17 support for set/map merge" >&2;} -fi + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; -fi - if test "$HAVE_CXX17" = "1" -a "x$have_cxx_all" = xyes -then : + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Found C++17 standard support" >&5 -printf "%s\n" "$as_me: Found C++17 standard support" >&6;} - if test $acsm_found_cxx -eq 0 -then : - acsm_cxx_version=17 -fi - acsm_found_cxx=1 -else case e in #( - e) CXX="$acsm_backup_CXX" - CXXCPP="$acsm_backup_CXXCPP" - if test "$HAVE_CXX17" = "0" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Did not find C++17 standard support" >&5 -printf "%s\n" "$as_me: Did not find C++17 standard support" >&6;} -fi ;; -esac -fi + } -fi +} // namespace cxx14 - if test 2014 -le "$acsm_CXX_STD_MAX" -then : +#endif // __cplusplus >= 201402L - if test 2014 -gt "$acsm_CXX_STD_MIN" -then : - ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=false - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - ac_success=no - cachevar=ax_cv_cxx_compile_cxx14 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features by default" >&5 -printf %s "checking whether $CXX supports C++14 features by default... " >&6; } -if eval test \${$cachevar+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -// If the compiler admits that it is not ready for C++11, why torture it? +// If the compiler admits that it is not ready for C++17, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L -#error "This is not a C++11 compiler" +#error "This is not a C++17 compiler" #else -namespace cxx11 +#include +#include +#include + +namespace cxx17 { - namespace test_static_assert + namespace test_constexpr_lambdas { - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; + constexpr int foo = [](){return 42;}(); } - namespace test_final_override + namespace test::nested_namespace::definitions { - struct Base + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) { - virtual ~Base() {} - virtual void f() {} - }; + return (args * ... * 1); + } - struct Derived : public Base + template + bool all(Args... args) { - virtual ~Derived() override {} - virtual void f() override {} - }; + return (args && ...); + } } - namespace test_double_right_angle_brackets + namespace test_extended_static_assert { - template < typename T > - struct check {}; + static_assert (true); - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; + } + + namespace test_auto_brace_init_list + { + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); } - namespace test_decltype + namespace test_typename_in_template_template_parameter { - int - f() + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() { - int a = 1; - decltype(a) b = 2; - return a + b; + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); } } - namespace test_type_deduction + namespace test_extended_aggregate_initialization { - template < typename T1, typename T2 > - struct is_same + struct base1 { - static const bool value = false; + int b1, b2 = 42; }; - template < typename T > - struct is_same + struct base2 { - static const bool value = true; + base2() { + b3 = 42; + } + int b3; }; - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) + struct derived : base1, base2 { - return a1 + a2; - } + int d; + }; - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases } - namespace test_noexcept + namespace test_general_range_based_for_loop { - int f() { return 0; } - int g() noexcept { return 0; } + struct iter + { + int i; - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); + int& operator* () + { + return i; + } - } + const int& operator* () const + { + return i; + } - namespace test_constexpr - { + iter& operator++() + { + ++i; + return *this; + } + }; - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + struct sentinel { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; } - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept + bool operator!= (const iter& i, const sentinel& s) { - return strlen_c_r(s, 0UL); + return !(i == s); } - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } } - namespace test_rvalue_references + namespace test_lambda_capture_asterisk_this_by_value { - template < int N > - struct answer + struct t { - static constexpr int value = N; + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } }; - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + } - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; } - namespace test_uniform_initialization + namespace test_constexpr_if { - struct test + template + int f () { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } } - namespace test_lambdas + namespace test_selection_statement_with_initializer { - void - test1() + int f() { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); + return 13; } - int - test2() + int f2() { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } + if (auto i = f(); i > 0) + { + return 3; + } - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } } } - namespace test_variadic_templates + namespace test_template_argument_deduction_for_class_templates { - template - struct sum; - - template - struct sum + template + struct pair { - static constexpr auto value = N0 + sum::value; - }; + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} - template <> - struct sum<> - { - static constexpr auto value = 0; + T1 m1; + T2 m2; }; - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } } - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae + namespace test_non_type_auto_template_parameters { - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); + template + struct B + {}; - void test() { func(0); } + B<5> b1; + B<'a'> b2; } -} // namespace cxx11 + namespace test_structured_bindings + { -#endif // __cplusplus >= 201103L + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + auto f1() -> int(&)[2] + { + return arr; + } + auto f2() -> std::pair& + { + return pr; + } + struct S + { + int x1 : 2; + volatile double y1; + }; -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. + S f3() + { + return {}; + } -#ifndef __cplusplus + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); -#error "This is not a C++ compiler" + } -#elif __cplusplus < 201402L + namespace test_exception_spec_type_system + { -#error "This is not a C++14 compiler" + struct Good {}; + struct Bad {}; -#else + void g1() noexcept; + void g2(); -namespace cxx14 -{ + template + Bad + f(T*, T*); - namespace test_polymorphic_lambdas - { + template + Good + f(T1*, T2*); - 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'); - } + static_assert (std::is_same_v); } - namespace test_binary_literals + namespace test_inline_variables { - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); + template void f(T) + {} - } + template inline T g(T) + { + return T{}; + } - namespace test_generalized_constexpr - { + template<> inline void f<>(int) + {} - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept + template<> int g<>(int) { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; + return 5; } - 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 - { +} // namespace cxx17 - 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(); - } +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L - } - namespace test_digit_separators - { - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - } +#ifndef __cplusplus - namespace test_return_type_deduction - { +#error "This is not a C++ compiler" - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; +#error "This is not a C++20 compiler" - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; +#else - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } +#include - } +namespace cxx20 +{ -} // namespace cxx14 +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. -#endif // __cplusplus >= 201402L +} // namespace cxx20 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L @@ -17264,30 +17191,69 @@ else case e in #( e) eval $cachevar=no ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes -then : - ac_success=yes -fi + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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_cxx20_required = xtrue; then if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 -printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } -if eval test \${$cachevar+y} + as_fn_error $? "*** A compiler with support for C++20 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX20=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++20 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++20 support was found" >&6;} + else + HAVE_CXX20=1 + +printf "%s\n" "#define HAVE_CXX20 1" >>confdefs.h + + fi + + +else case e in #( + e) ax_cxx_compile_alternatives="20" ax_cxx_compile_cxx20_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + ac_success=no + + + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++20 features by default" >&5 +printf %s "checking whether $CXX supports C++20 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx20+y} then : printf %s "(cached) " >&6 else case e in #( - e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17298,7 +17264,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -17585,7 +17565,7 @@ namespace cxx11 #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -17697,38 +17677,444 @@ namespace cxx14 + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + + + _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - eval $cachevar=yes + ax_cv_cxx_compile_cxx20=yes else case e in #( - e) eval $cachevar=no ;; + e) ax_cv_cxx_compile_cxx20=no ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx20" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx20" >&6; } + if test x$ax_cv_cxx_compile_cxx20 = xyes; then + ac_success=yes + fi fi + + + + + 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=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 -printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx20_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx20_$switch" | sed "$as_sed_sh"` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++20 features with $switch" >&5 +printf %s "checking whether $CXX supports C++20 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 @@ -17746,7 +18132,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -18033,7 +18433,7 @@ namespace cxx11 #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -18145,481 +18545,407 @@ namespace cxx14 -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval $cachevar=yes -else case e in #( - e) eval $cachevar=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; -esac -fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 - fi - fi - if test x$ac_success = xno; then - HAVE_CXX14=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++14 support was found" >&6;} - else - HAVE_CXX14=1 - -printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h - - fi - - -else case e in #( - e) ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=true - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - ac_success=no - - cachevar=ax_cv_cxx_compile_cxx14 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features by default" >&5 -printf %s "checking whether $CXX supports C++14 features by default... " >&6; } -if eval test \${$cachevar+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -// If the compiler admits that it is not ready for C++11, why torture it? +// If the compiler admits that it is not ready for C++17, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L -#error "This is not a C++11 compiler" +#error "This is not a C++17 compiler" #else -namespace cxx11 +#include +#include +#include + +namespace cxx17 { - namespace test_static_assert + namespace test_constexpr_lambdas { - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; + constexpr int foo = [](){return 42;}(); } - namespace test_final_override + namespace test::nested_namespace::definitions { - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; + } - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets + namespace test_fold_expression { - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { + template + int multiply(Args... args) + { + return (args * ... * 1); + } - int - f() + template + bool all(Args... args) { - int a = 1; - decltype(a) b = 2; - return a + b; + return (args && ...); } } - namespace test_type_deduction + namespace test_extended_static_assert { - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; + static_assert (true); - template < typename T > - struct is_same - { - static const bool value = true; - }; + } - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } + namespace test_auto_brace_init_list + { - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } + auto foo = {5}; + auto bar {5}; + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); } - namespace test_noexcept + namespace test_typename_in_template_template_parameter { - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); + template typename X> struct D; } - namespace test_constexpr + namespace test_fallthrough_nodiscard_maybe_unused_attributes { - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + int f1() { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; + return 42; } - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept + [[nodiscard]] int f2() { - return strlen_c_r(s, 0UL); - } + [[maybe_unused]] auto unused = f1(); - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } } - namespace test_rvalue_references + namespace test_extended_aggregate_initialization { - template < int N > - struct answer + struct base1 { - static constexpr int value = N; + int b1, b2 = 42; }; - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; - void - test() + struct derived : base1, base2 { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases } - namespace test_uniform_initialization + namespace test_general_range_based_for_loop { - struct test + struct iter { - static const int zero {}; - static const int one {1}; - }; + int i; - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); + int& operator* () + { + return i; + } - } + const int& operator* () const + { + return i; + } - namespace test_lambdas - { + iter& operator++() + { + ++i; + return *this; + } + }; - void - test1() + struct sentinel { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } + int i; + }; - int - test2() + bool operator== (const iter& i, const sentinel& s) { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; + return i.i == s.i; } - int - test3() + bool operator!= (const iter& i, const sentinel& s) { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); + return !(i == s); } - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum + struct range { - static constexpr auto value = N0 + sum::value; + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } }; - template <> - struct sum<> + void f() { - static constexpr auto value = 0; - }; + range r {}; - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } } - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae + namespace test_lambda_capture_asterisk_this_by_value { - struct foo {}; - - template - using member = typename T::member_type; + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; - template - void func(...) {} + } - template - void func(member*) {} + namespace test_enum_class_construction + { - void test(); + enum class byte : unsigned char + {}; - void test() { func(0); } + byte foo {42}; } -} // namespace cxx11 - -#endif // __cplusplus >= 201103L + namespace test_constexpr_if + { + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + } + namespace test_selection_statement_with_initializer + { -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. + int f() + { + return 13; + } -#ifndef __cplusplus + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } -#error "This is not a C++ compiler" + switch (auto i = f(); i + 4) + { + case 17: + return 2; -#elif __cplusplus < 201402L + default: + return 1; + } + } -#error "This is not a C++14 compiler" + } -#else + namespace test_template_argument_deduction_for_class_templates + { -namespace cxx14 -{ + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} - namespace test_polymorphic_lambdas - { + T1 m1; + T2 m2; + }; - int - test() + void f() { - 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'); + [[maybe_unused]] auto p = pair{13, 42u}; } } - namespace test_binary_literals + namespace test_non_type_auto_template_parameters { - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); + template + struct B + {}; + + B<5> b1; + B<'a'> b2; } - namespace test_generalized_constexpr + namespace test_structured_bindings { - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; + return arr; } - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } + auto f2() -> std::pair& + { + return pr; + } - namespace test_lambda_init_capture - { + struct S + { + int x1 : 2; + volatile double y1; + }; - int - test() + S f3() { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); + return {}; } + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + } - namespace test_digit_separators + namespace test_exception_spec_type_system { - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); } - namespace test_return_type_deduction + namespace test_inline_variables { - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } + template void f(T) + {} - template < typename T1, typename T2 > - struct is_same + template inline T g(T) { - static constexpr auto value = false; - }; + return T{}; + } - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; + template<> inline void f<>(int) + {} - int - test() + template<> int g<>(int) { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; + return 5; } } -} // namespace cxx14 +} // namespace cxx17 -#endif // __cplusplus >= 201402L +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 202002L @@ -18631,41 +18957,9072 @@ else case e in #( e) eval $cachevar=no ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes -then : - ac_success=yes -fi + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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_cxx20_required = xtrue; then if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 -printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } -if eval test \${$cachevar+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + as_fn_error $? "*** A compiler with support for C++20 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX20=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++20 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++20 support was found" >&6;} + else + HAVE_CXX20=1 +printf "%s\n" "#define HAVE_CXX20 1" >>confdefs.h -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. + fi + + ;; +esac +fi + eval "HAVE_TESTED_CXX=\${HAVE_CXX$CXX_YEAR}" + if test "$HAVE_TESTED_CXX" = "1" -a $acsm_found_cxx -eq 0 +then : + + # If nothing fails later we're good to go + have_cxx_all=yes + + # -------------------------------------------------------------- + # Test for mandatory C++11 features, those which libMesh now requires + # for internal use. + # -------------------------------------------------------------- + + have_cxx11_auto=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 auto keyword support" >&5 +printf %s "checking for C++11 auto keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + int x = 5; + auto y = x; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_AUTO 1" >>confdefs.h + + have_cxx11_auto=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_auto == xyes; then + HAVE_CXX11_AUTO_TRUE= + HAVE_CXX11_AUTO_FALSE='#' +else + HAVE_CXX11_AUTO_TRUE='#' + HAVE_CXX11_AUTO_FALSE= +fi + + + if test "x$have_cxx11_auto" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 auto variable support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 auto variable support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_rangefor=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 range-based for loop support" >&5 +printf %s "checking for C++11 range-based for loop support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + void print(const std::vector & v) + { + for (const int & x : v) + std::cout << x << ' '; + std::cout << std::endl; + } + +int +main (void) +{ + + std::vector v(3); + print(v); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_RANGEFOR 1" >>confdefs.h + + have_cxx11_rangefor=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_rangefor == xyes; then + HAVE_CXX11_RANGEFOR_TRUE= + HAVE_CXX11_RANGEFOR_FALSE='#' +else + HAVE_CXX11_RANGEFOR_TRUE='#' + HAVE_CXX11_RANGEFOR_FALSE= +fi + + + if test "x$have_cxx11_rangefor" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 ranged-for loop support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 ranged-for loop support" >&2;} + have_cxx_all=no +fi + + # Technically we require uniform initialization, but this is the + # closest test we have + + have_cxx11_initializer_list=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 initializer list support" >&5 +printf %s "checking for C++11 initializer list support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + std::vector v = { "xyzzy", "plugh", "abracadabra" }; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_INITIALIZER_LIST 1" >>confdefs.h + + have_cxx11_initializer_list=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_initializer_list == xyes; then + HAVE_CXX11_INITIALIZER_LIST_TRUE= + HAVE_CXX11_INITIALIZER_LIST_FALSE='#' +else + HAVE_CXX11_INITIALIZER_LIST_TRUE='#' + HAVE_CXX11_INITIALIZER_LIST_FALSE= +fi + + + if test "x$have_cxx11_initializer_list" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 initializer list support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 initializer list support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_unique_ptr=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::unique_ptr support" >&5 +printf %s "checking for C++11 std::unique_ptr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + struct Foo + { + Foo() { std::cout << "Foo::Foo\n"; } + ~Foo() { std::cout << "Foo::~Foo\n"; } + }; + +int +main (void) +{ + + { + // up now owns a Foo + std::unique_ptr up(new Foo); + } // Foo deleted when up goes out of scope + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_UNIQUE_PTR 1" >>confdefs.h + + have_cxx11_unique_ptr=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_unique_ptr == xyes; then + HAVE_CXX11_UNIQUE_PTR_TRUE= + HAVE_CXX11_UNIQUE_PTR_FALSE='#' +else + HAVE_CXX11_UNIQUE_PTR_TRUE='#' + HAVE_CXX11_UNIQUE_PTR_FALSE= +fi + + + if test "x$have_cxx11_unique_ptr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::unique_ptr support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::unique_ptr support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_make_unique_workaround=no + + # This is a simple workaround for no std::make_unique in C++11: + # http://stackoverflow.com/questions/7038357/make-unique-and-perfect-forwarding + # Requires working rvalue references, std::forward, variadic + # templates, and std::unique_ptr from C++11. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::make_unique workaround support" >&5 +printf %s "checking for C++11 std::make_unique workaround support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + namespace local + { + template + std::unique_ptr make_unique(Args&&... args) + { + return std::unique_ptr(new T(std::forward(args)...)); + } + } + +int +main (void) +{ + + { + // Normally, you would use "auto" on the LHS here to avoid + // repeating the type name, but we are not testing auto here. + std::unique_ptr up = local::make_unique(42); + } // Foo deleted when up goes out of scope + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_MAKE_UNIQUE_WORKAROUND 1" >>confdefs.h + + have_cxx11_make_unique_workaround=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_make_unique_workaround == xyes; then + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE= + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE='#' +else + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE='#' + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE= +fi + + + if test "x$have_cxx11_make_unique_workaround" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 variadic template support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 variadic template support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_tuple=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::tuple support" >&5 +printf %s "checking for C++11 std::tuple support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + // Test std::make_tuple + std::map> students; + students[0] = std::make_tuple(3.8, 'A', "Lisa Simpson"); + students[1] = std::make_tuple(2.9, 'C', "Milhouse Van Houten"); + + // Test templated std::get() method. + std::get<0>(students[0]); + std::get<1>(students[0]); + std::get<2>(students[0]); + + // Test std::tie and std::ignore which are declared in the header. + double gpa1; + std::string name1; + std::tie(gpa1, std::ignore, name1) = students[1]; + + // Test std::tuple_cat(), which combines together one or more + // objects, not necessarily tuples, into a single tuple. + auto t = std::tuple_cat(students[0], students[1], std::make_pair("foo", 42)); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_TUPLE 1" >>confdefs.h + + have_cxx11_tuple=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_tuple == xyes; then + HAVE_CXX11_TUPLE_TRUE= + HAVE_CXX11_TUPLE_FALSE='#' +else + HAVE_CXX11_TUPLE_TRUE='#' + HAVE_CXX11_TUPLE_FALSE= +fi + + + if test "x$have_cxx11_tuple" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::tuple support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::tuple support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_lambda=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 lambda support" >&5 +printf %s "checking for C++11 lambda support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + // typedef for a function pointer that takes int and returns bool. + typedef bool (*FunctionPointer) (int); + + // A function that takes a pointer to a function that takes an int, + // calls it with the number 4, and returns the result. + bool f(FunctionPointer g) { return g(4); } + +int +main (void) +{ + + // Call f, passing it a lambda constructed on the fly instead + // of a standard function pointer. The result should be true. + f ( [](int x) { return x > 3; } ); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_LAMBDA 1" >>confdefs.h + + have_cxx11_lambda=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_lambda == xyes; then + HAVE_CXX11_LAMBDA_TRUE= + HAVE_CXX11_LAMBDA_FALSE='#' +else + HAVE_CXX11_LAMBDA_TRUE='#' + HAVE_CXX11_LAMBDA_FALSE= +fi + + + if test "x$have_cxx11_lambda" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 lambda support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 lambda support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_fixed_type_enum=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 fixed type enumeration support" >&5 +printf %s "checking for C++11 fixed type enumeration support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + enum Fruit : int {APPLE=0, ORANGE=1}; + +int +main (void) +{ + + Fruit f = APPLE; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_FIXED_TYPE_ENUM 1" >>confdefs.h + + have_cxx11_fixed_type_enum=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_fixed_type_enum == xyes; then + HAVE_CXX11_FIXED_TYPE_ENUM_TRUE= + HAVE_CXX11_FIXED_TYPE_ENUM_FALSE='#' +else + HAVE_CXX11_FIXED_TYPE_ENUM_TRUE='#' + HAVE_CXX11_FIXED_TYPE_ENUM_FALSE= +fi + + + if test "x$have_cxx11_fixed_type_enum" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 fixed type enumeration support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 fixed type enumeration support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_fixed_type_enum_fwd=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 fixed type enumeration forward declaration support" >&5 +printf %s "checking for C++11 fixed type enumeration forward declaration support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + enum Foo : int; + void func(Foo f) { std::cout << f << std::endl; } + enum Foo : int { FOO0 = 0, FOO1 = 1, FOO2 = 2 }; + +int +main (void) +{ + + func(FOO0); + func(FOO1); + func(FOO2); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_FIXED_TYPE_ENUM_FWD 1" >>confdefs.h + + have_cxx11_fixed_type_enum_fwd=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_fixed_type_enum_fwd == xyes; then + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE= + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE='#' +else + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE='#' + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE= +fi + + + if test "x$have_cxx11_fixed_type_enum_fwd" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 fixed type enumeration forward declaration support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 fixed type enumeration forward declaration support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_override=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 override keyword support" >&5 +printf %s "checking for C++11 override keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + struct Base { + virtual void f() {} + }; + struct Child : public Base { + virtual void f() override {} + }; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_OVERRIDE 1" >>confdefs.h + + have_cxx11_override=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_override == xyes; then + HAVE_CXX11_OVERRIDE_TRUE= + HAVE_CXX11_OVERRIDE_FALSE='#' +else + HAVE_CXX11_OVERRIDE_TRUE='#' + HAVE_CXX11_OVERRIDE_FALSE= +fi + + + if test "x$have_cxx11_override" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 compiler support the override keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 compiler support the override keyword" >&2;} + have_cxx_all=no +fi + + + have_cxx11_move_constructors=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 move constructor support" >&5 +printf %s "checking for C++11 move constructor support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + class move_constructable_base + { + public: + move_constructable_base() {} + move_constructable_base(move_constructable_base && other) noexcept {} + }; + class move_constructable : public move_constructable_base + { + public: + move_constructable() {} + move_constructable(move_constructable && other) noexcept : move_constructable_base(std::move(other)) {} + }; + +int +main (void) +{ + + move_constructable m1; + move_constructable m2(std::move(m1)); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_MOVE_CONSTRUCTORS 1" >>confdefs.h + + have_cxx11_move_constructors=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_move_constructors == xyes; then + HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE= + HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE='#' +else + HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE='#' + HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE= +fi + + + if test "x$have_cxx11_move_constructors" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 move constructor support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 move constructor support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_deleted_functions=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 deleted functions support" >&5 +printf %s "checking for C++11 deleted functions support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + class Foo + { + Foo(const Foo &) = delete; + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_DELETED_FUNCTIONS 1" >>confdefs.h + + have_cxx11_deleted_functions=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_deleted_functions == xyes; then + HAVE_CXX11_DELETED_FUNCTIONS_TRUE= + HAVE_CXX11_DELETED_FUNCTIONS_FALSE='#' +else + HAVE_CXX11_DELETED_FUNCTIONS_TRUE='#' + HAVE_CXX11_DELETED_FUNCTIONS_FALSE= +fi + + + if test "x$have_cxx11_deleted_functions" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 deleted function support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 deleted function support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_defaulted_functions=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 defaulted functions support" >&5 +printf %s "checking for C++11 defaulted functions support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + class Foo + { + Foo(const Foo &) = default; + ~Foo(); + }; + Foo::~Foo() = default; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_DEFAULTED_FUNCTIONS 1" >>confdefs.h + + have_cxx11_defaulted_functions=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_defaulted_functions == xyes; then + HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE= + HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE='#' +else + HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE='#' + HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE= +fi + + + if test "x$have_cxx11_defaulted_functions" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 defaulted function support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 defaulted function support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_nullptr=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 nullptr support" >&5 +printf %s "checking for C++11 nullptr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + void f(int * pi) {} + void f(double * pd) {} + void f(std::nullptr_t nullp) {} + +int +main (void) +{ + + // would be ambiguous without void f(nullptr_t) + f(nullptr); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_NULLPTR 1" >>confdefs.h + + have_cxx11_nullptr=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_nullptr == xyes; then + HAVE_CXX11_NULLPTR_TRUE= + HAVE_CXX11_NULLPTR_FALSE='#' +else + HAVE_CXX11_NULLPTR_TRUE='#' + HAVE_CXX11_NULLPTR_FALSE= +fi + + + if test "x$have_cxx11_nullptr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 nullptr keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 nullptr keyword" >&2;} + have_cxx_all=no +fi + + + have_cxx11_final=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 'final' keyword support" >&5 +printf %s "checking for C++11 'final' keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + // Test that a function can be declared final. + struct A + { + virtual void foo() final; + }; + + // Test that a struct can be declared final. + struct B final : A + { + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + have_cxx11_final=yes + +else case e in #( + e) + have_cxx11_final=no + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Confirm that you cannot declare a non-virtual function 'final'. + if test "x$have_cxx11_final" != "xno" +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + struct A + { + // Error: non-virtual function cannot be final + void bar() final; + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no + +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + + if test "x$have_cxx11_final" != "xno" +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + struct A + { + virtual void foo() final; + }; + struct B : A + { + // Error: foo cannot be overridden as it's final in A + void foo(); + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no + +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + + if test "x$have_cxx11_final" != "xno" +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + struct A + { + }; + + // struct B is final + struct B final : A + { + }; + + // Error: B is final + struct C : B + { + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no + +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + + # If the flag is still 'yes' after all the tests, set the #define. + if test "x$have_cxx11_final" = "xyes" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_FINAL 1" >>confdefs.h + + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac +fi + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_final == xyes; then + HAVE_CXX11_FINAL_TRUE= + HAVE_CXX11_FINAL_FALSE='#' +else + HAVE_CXX11_FINAL_TRUE='#' + HAVE_CXX11_FINAL_FALSE= +fi + + + if test "x$have_cxx11_final" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 final keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 final keyword" >&2;} + have_cxx_all=no +fi + + + have_cxx11_decltype=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 decltype support" >&5 +printf %s "checking for C++11 decltype support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + int a; + decltype(a) b; + std::vector vec(10); + for (auto i = decltype(vec.size())(0); i < vec.size(); ++i) + vec[i] += i; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_DECLTYPE 1" >>confdefs.h + + have_cxx11_decltype=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_decltype == xyes; then + HAVE_CXX11_DECLTYPE_TRUE= + HAVE_CXX11_DECLTYPE_FALSE='#' +else + HAVE_CXX11_DECLTYPE_TRUE='#' + HAVE_CXX11_DECLTYPE_FALSE= +fi + + + if test "x$have_cxx11_decltype" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 decltype keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 decltype keyword" >&2;} + have_cxx_all=no +fi + + + have_cxx11_begin_end=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::begin/end support for arrays" >&5 +printf %s "checking for C++11 std::begin/end support for arrays... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + int array[5] = {3, 1, 5, 2, 4}; + std::sort(std::begin(array), std::end(array)); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_begin_end=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_begin_end" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::begin/end support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::begin/end support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_container_erase=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std container erase() functions returning iterators" >&5 +printf %s "checking for C++11 std container erase() functions returning iterators... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + { + std::map m; + m.insert(std::make_pair(1,2)); + std::map::iterator it = m.erase(m.begin()); + } + { + std::set s; + s.insert(1); + std::set::iterator it = s.erase(s.begin()); + } + { + std::multimap m; + m.insert(std::make_pair(1,2)); + std::multimap::iterator it = m.erase(m.begin()); + } + { + std::multiset s; + s.insert(1); + std::multiset::iterator it = s.erase(s.begin()); + } + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_container_erase=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_container_erase" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std container erase() functions returning iterators" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std container erase() functions returning iterators" >&2;} + have_cxx_all=no +fi + + + have_cxx11_container_emplace=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std container emplace() functions" >&5 +printf %s "checking for C++11 std container emplace() functions... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + { + std::map m; + m.emplace(1,2); + m.emplace_hint(m.begin(), 0, 3); + } + { + std::set s; + s.emplace(1); + s.emplace_hint(s.begin(), 0); + } + { + std::multimap m; + m.emplace(1,2); + m.emplace_hint(m.begin(), 0, 3); + } + { + std::multiset s; + s.emplace(1); + s.emplace_hint(s.begin(), 0); + } + { + std::vector v; + v.emplace(v.begin(), 0); + v.emplace_back(1); + } + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_container_emplace=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_container_emplace" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std container emplace() functions" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std container emplace() functions" >&2;} + have_cxx_all=no +fi + + + have_cxx11_iota=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::iota algorithm" >&5 +printf %s "checking for C++11 std::iota algorithm... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + std::vector v(10); + std::iota(v.begin(), v.end(), 0); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_iota=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_iota" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::iota" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::iota" >&2;} + have_cxx_all=no +fi + + + have_cxx11_vector_data=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::vector::data() API" >&5 +printf %s "checking for C++11 std::vector::data() API... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + std::vector v(10); + int * begin = v.data(); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_vector_data=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_vector_data" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::vector::data()" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::vector::data()" >&2;} + have_cxx_all=no +fi + + + have_cxx11_shared_ptr=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::shared_ptr support" >&5 +printf %s "checking for C++11 std::shared_ptr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + # Save any original value that CXXFLAGS had + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + std::shared_ptr p1; + std::shared_ptr p2 (new int); + std::shared_ptr p3 (p2); + p3.reset(new int); + p3 = std::make_shared(5); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + have_cxx11_shared_ptr=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else case e in #( + e) + have_cxx11_shared_ptr=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + if test "x$have_cxx11_shared_ptr" = "xyes" +then : + +printf "%s\n" "#define HAVE_CXX11_SHARED_PTR 1" >>confdefs.h + +fi + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_shared_ptr == xyes; then + HAVE_CXX11_SHARED_PTR_TRUE= + HAVE_CXX11_SHARED_PTR_FALSE='#' +else + HAVE_CXX11_SHARED_PTR_TRUE='#' + HAVE_CXX11_SHARED_PTR_FALSE= +fi + + + if test "x$have_cxx11_shared_ptr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::shared_ptr" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::shared_ptr" >&2;} + have_cxx_all=no +fi + + + have_cxx11_rvalue_references=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 rvalue references support" >&5 +printf %s "checking for C++11 rvalue references support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int foo(int && x) { return x; } + int bar() { return 4; } + +int +main (void) +{ + + // Call function that takes an rvalue reference. + foo (bar()); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_RVALUE_REFERENCES 1" >>confdefs.h + + have_cxx11_rvalue_references=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_rvalue_references == xyes; then + HAVE_CXX11_RVALUE_REFERENCES_TRUE= + HAVE_CXX11_RVALUE_REFERENCES_FALSE='#' +else + HAVE_CXX11_RVALUE_REFERENCES_TRUE='#' + HAVE_CXX11_RVALUE_REFERENCES_FALSE= +fi + + + if test "x$have_cxx11_rvalue_references" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for rvalue references" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for rvalue references" >&2;} + have_cxx_all=no +fi + + + have_cxx11_to_string=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::to_string() support" >&5 +printf %s "checking for C++11 std::to_string() support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + // tiny="0.000000". Note: std::to_string(double) is required to produce + // a std::string with the same contents as std::sprintf(buf, "%f", value) + // would produce, given a sufficiently large buf. This is *different* from + // what you get from a std::stringstream using default formatting and + // precision flags, i.e. + // std::ostringstream oss; + // oss << 1.e-40; + // std::string tiny = oss.str(); + // will produce the string "1e-40". + std::string tiny = std::to_string(1.e-40); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_TO_STRING 1" >>confdefs.h + + have_cxx11_to_string=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_to_string == xyes; then + HAVE_CXX11_TO_STRING_TRUE= + HAVE_CXX11_TO_STRING_FALSE='#' +else + HAVE_CXX11_TO_STRING_TRUE='#' + HAVE_CXX11_TO_STRING_FALSE= +fi + + + if test "x$have_cxx11_to_string" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::to_string()" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::to_string()" >&2;} + have_cxx_all=no +fi + + + have_cxx11_constexpr=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 constexpr support" >&5 +printf %s "checking for C++11 constexpr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + constexpr int multiply (int x, int y) { return x * y; } + +int +main (void) +{ + + // The compiler should compute "val" at compile time. + const int val = multiply(10, 10); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_CONSTEXPR 1" >>confdefs.h + + have_cxx11_constexpr=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_constexpr == xyes; then + HAVE_CXX11_CONSTEXPR_TRUE= + HAVE_CXX11_CONSTEXPR_FALSE='#' +else + HAVE_CXX11_CONSTEXPR_TRUE='#' + HAVE_CXX11_CONSTEXPR_FALSE= +fi + + + if test "x$have_cxx11_constexpr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for constexpr" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for constexpr" >&2;} + have_cxx_all=no +fi + + + have_cxx11_variadic_templates=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 variadic template support" >&5 +printf %s "checking for C++11 variadic template support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + // Base case + template + T sum(T t) { return t; } + + // Compute sum of arbitrary number of passed parameters. + template + T sum(T t, P ...p) + { + t += sum(p...); + return t; + } + +int +main (void) +{ + + sum(1, 2, 3, 4, 5); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_VARIADIC_TEMPLATES 1" >>confdefs.h + + have_cxx11_variadic_templates=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_variadic_templates == xyes; then + HAVE_CXX11_VARIADIC_TEMPLATES_TRUE= + HAVE_CXX11_VARIADIC_TEMPLATES_FALSE='#' +else + HAVE_CXX11_VARIADIC_TEMPLATES_TRUE='#' + HAVE_CXX11_VARIADIC_TEMPLATES_FALSE= +fi + + + if test "x$have_cxx11_variadic_templates" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for variadic templates" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for variadic templates" >&2;} + have_cxx_all=no +fi + + + have_cxx11_alias_declarations=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 alias declarations support" >&5 +printf %s "checking for C++11 alias declarations support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + template + struct check + { + T t; + }; + + // An alias declaration is like a templated typedef + template + using MyCheck = check; + +int +main (void) +{ + + MyCheck mc; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_ALIAS_DECLARATIONS 1" >>confdefs.h + + have_cxx11_alias_declarations=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_alias_declarations == xyes; then + HAVE_CXX11_ALIAS_DECLARATIONS_TRUE= + HAVE_CXX11_ALIAS_DECLARATIONS_FALSE='#' +else + HAVE_CXX11_ALIAS_DECLARATIONS_TRUE='#' + HAVE_CXX11_ALIAS_DECLARATIONS_FALSE= +fi + + + if test "x$have_cxx11_alias_declarations" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for alias declarations" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for alias declarations" >&2;} + have_cxx_all=no +fi + + + have_cxx11_array=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::array" >&5 +printf %s "checking for C++11 std::array... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + std::array a; + a[0] = 42.0; + double * begin = a.data(); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_array=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_array" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::array" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::array" >&2;} + have_cxx_all=no +fi + + + have_cxx11_isnan=no + have_cxx11_isinf=no + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isnan" >&5 +printf %s "checking for C++11 std::isnan... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + if (std::isnan(0.0)) + return 1; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_isnan=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isinf" >&5 +printf %s "checking for C++11 std::isinf... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + if (std::isinf(0.0)) + return 1; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_isinf=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_isnan" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isnan" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isnan" >&2;} + have_cxx_all=no +fi + if test "x$have_cxx11_isinf" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isinf" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isinf" >&2;} + have_cxx_all=no +fi + + + have_cxx17_splicing=no + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 std::*::merge" >&5 +printf %s "checking for C++17 std::*::merge... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + +int +main (void) +{ + + std::set s1{1}, s2{2}; + std::unordered_set us1{3}, us2{4}; + std::map m1{{5,6}}, m2{{7,8}}; + std::unordered_map um1{{9,10}}, um2{{11,12}}; + s1.merge(std::move(s2)); + us1.merge(std::move(us2)); + m1.merge(std::move(m2)); + um1.merge(std::move(um2)); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx17_splicing=yes + +printf "%s\n" "#define HAVE_CXX17_SPLICING 1" >>confdefs.h + + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx17_splicing" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh prefers C++17 support for set/map merge" >&5 +printf "%s\n" "$as_me: WARNING: libMesh prefers C++17 support for set/map merge" >&2;} +fi + +fi + if test "$HAVE_TESTED_CXX" = "1" -a "x$have_cxx_all" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Found C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Found C++$CXX_YEAR standard support" >&6;} + if test $acsm_found_cxx -eq 0 +then : + acsm_cxx_version=$CXX_YEAR +fi + acsm_found_cxx=1 +else case e in #( + e) CXX="$acsm_backup_CXX" + CXXCPP="$acsm_backup_CXXCPP" + if test "$HAVE_CXX17" = "0" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Did not find C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Did not find C++$CXX_YEAR standard support" >&6;} +fi ;; +esac +fi + +fi + + CXX_YEAR=17 + if test "20$CXX_YEAR" -le "$acsm_CXX_STD_MAX" -a $acsm_found_cxx -eq 0 +then : + + if test "20$CXX_YEAR" -gt "$acsm_CXX_STD_MIN" +then : + ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + ac_success=no + + + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features by default" >&5 +printf %s "checking whether $CXX supports C++17 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx17+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// 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 && !defined _MSC_VER + +#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 + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_cxx_compile_cxx17=yes +else case e in #( + e) ax_cv_cxx_compile_cxx17=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx17" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx17" >&6; } + if test x$ax_cv_cxx_compile_cxx17 = xyes; then + ac_success=yes + fi + fi + + + + + + + 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}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | sed "$as_sed_sh"` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// 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 && !defined _MSC_VER + +#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 + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else case e in #( + e) eval $cachevar=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" ;; +esac +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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_cxx17_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX17=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} + else + HAVE_CXX17=1 + +printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h + + fi + + +else case e in #( + e) ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + ac_success=no + + + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features by default" >&5 +printf %s "checking whether $CXX supports C++17 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx17+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// 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 && !defined _MSC_VER + +#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 + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_cxx_compile_cxx17=yes +else case e in #( + e) ax_cv_cxx_compile_cxx17=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx17" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx17" >&6; } + if test x$ax_cv_cxx_compile_cxx17 = xyes; then + ac_success=yes + fi + fi + + + + + + + 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}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx17_$switch" | sed "$as_sed_sh"` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +printf %s "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// 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 && !defined _MSC_VER + +#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 + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // (defined _MSVC_LANG ? _MSVC_LANG : __cplusplus) < 201703L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else case e in #( + e) eval $cachevar=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" ;; +esac +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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_cxx17_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX17=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++17 support was found" >&6;} + else + HAVE_CXX17=1 + +printf "%s\n" "#define HAVE_CXX17 1" >>confdefs.h + + fi + + ;; +esac +fi + eval "HAVE_TESTED_CXX=\${HAVE_CXX$CXX_YEAR}" + if test "$HAVE_TESTED_CXX" = "1" -a $acsm_found_cxx -eq 0 +then : + + # If nothing fails later we're good to go + have_cxx_all=yes + + # -------------------------------------------------------------- + # Test for mandatory C++11 features, those which libMesh now requires + # for internal use. + # -------------------------------------------------------------- + + have_cxx11_auto=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 auto keyword support" >&5 +printf %s "checking for C++11 auto keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + int x = 5; + auto y = x; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_AUTO 1" >>confdefs.h + + have_cxx11_auto=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_auto == xyes; then + HAVE_CXX11_AUTO_TRUE= + HAVE_CXX11_AUTO_FALSE='#' +else + HAVE_CXX11_AUTO_TRUE='#' + HAVE_CXX11_AUTO_FALSE= +fi + + + if test "x$have_cxx11_auto" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 auto variable support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 auto variable support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_rangefor=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 range-based for loop support" >&5 +printf %s "checking for C++11 range-based for loop support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + void print(const std::vector & v) + { + for (const int & x : v) + std::cout << x << ' '; + std::cout << std::endl; + } + +int +main (void) +{ + + std::vector v(3); + print(v); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_RANGEFOR 1" >>confdefs.h + + have_cxx11_rangefor=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_rangefor == xyes; then + HAVE_CXX11_RANGEFOR_TRUE= + HAVE_CXX11_RANGEFOR_FALSE='#' +else + HAVE_CXX11_RANGEFOR_TRUE='#' + HAVE_CXX11_RANGEFOR_FALSE= +fi + + + if test "x$have_cxx11_rangefor" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 ranged-for loop support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 ranged-for loop support" >&2;} + have_cxx_all=no +fi + + # Technically we require uniform initialization, but this is the + # closest test we have + + have_cxx11_initializer_list=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 initializer list support" >&5 +printf %s "checking for C++11 initializer list support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + std::vector v = { "xyzzy", "plugh", "abracadabra" }; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_INITIALIZER_LIST 1" >>confdefs.h + + have_cxx11_initializer_list=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_initializer_list == xyes; then + HAVE_CXX11_INITIALIZER_LIST_TRUE= + HAVE_CXX11_INITIALIZER_LIST_FALSE='#' +else + HAVE_CXX11_INITIALIZER_LIST_TRUE='#' + HAVE_CXX11_INITIALIZER_LIST_FALSE= +fi + + + if test "x$have_cxx11_initializer_list" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 initializer list support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 initializer list support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_unique_ptr=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::unique_ptr support" >&5 +printf %s "checking for C++11 std::unique_ptr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + struct Foo + { + Foo() { std::cout << "Foo::Foo\n"; } + ~Foo() { std::cout << "Foo::~Foo\n"; } + }; + +int +main (void) +{ + + { + // up now owns a Foo + std::unique_ptr up(new Foo); + } // Foo deleted when up goes out of scope + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_UNIQUE_PTR 1" >>confdefs.h + + have_cxx11_unique_ptr=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_unique_ptr == xyes; then + HAVE_CXX11_UNIQUE_PTR_TRUE= + HAVE_CXX11_UNIQUE_PTR_FALSE='#' +else + HAVE_CXX11_UNIQUE_PTR_TRUE='#' + HAVE_CXX11_UNIQUE_PTR_FALSE= +fi + + + if test "x$have_cxx11_unique_ptr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::unique_ptr support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::unique_ptr support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_make_unique_workaround=no + + # This is a simple workaround for no std::make_unique in C++11: + # http://stackoverflow.com/questions/7038357/make-unique-and-perfect-forwarding + # Requires working rvalue references, std::forward, variadic + # templates, and std::unique_ptr from C++11. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::make_unique workaround support" >&5 +printf %s "checking for C++11 std::make_unique workaround support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + namespace local + { + template + std::unique_ptr make_unique(Args&&... args) + { + return std::unique_ptr(new T(std::forward(args)...)); + } + } + +int +main (void) +{ + + { + // Normally, you would use "auto" on the LHS here to avoid + // repeating the type name, but we are not testing auto here. + std::unique_ptr up = local::make_unique(42); + } // Foo deleted when up goes out of scope + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_MAKE_UNIQUE_WORKAROUND 1" >>confdefs.h + + have_cxx11_make_unique_workaround=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_make_unique_workaround == xyes; then + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE= + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE='#' +else + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE='#' + HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE= +fi + + + if test "x$have_cxx11_make_unique_workaround" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 variadic template support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 variadic template support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_tuple=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::tuple support" >&5 +printf %s "checking for C++11 std::tuple support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + // Test std::make_tuple + std::map> students; + students[0] = std::make_tuple(3.8, 'A', "Lisa Simpson"); + students[1] = std::make_tuple(2.9, 'C', "Milhouse Van Houten"); + + // Test templated std::get() method. + std::get<0>(students[0]); + std::get<1>(students[0]); + std::get<2>(students[0]); + + // Test std::tie and std::ignore which are declared in the header. + double gpa1; + std::string name1; + std::tie(gpa1, std::ignore, name1) = students[1]; + + // Test std::tuple_cat(), which combines together one or more + // objects, not necessarily tuples, into a single tuple. + auto t = std::tuple_cat(students[0], students[1], std::make_pair("foo", 42)); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_TUPLE 1" >>confdefs.h + + have_cxx11_tuple=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_tuple == xyes; then + HAVE_CXX11_TUPLE_TRUE= + HAVE_CXX11_TUPLE_FALSE='#' +else + HAVE_CXX11_TUPLE_TRUE='#' + HAVE_CXX11_TUPLE_FALSE= +fi + + + if test "x$have_cxx11_tuple" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::tuple support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::tuple support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_lambda=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 lambda support" >&5 +printf %s "checking for C++11 lambda support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + // typedef for a function pointer that takes int and returns bool. + typedef bool (*FunctionPointer) (int); + + // A function that takes a pointer to a function that takes an int, + // calls it with the number 4, and returns the result. + bool f(FunctionPointer g) { return g(4); } + +int +main (void) +{ + + // Call f, passing it a lambda constructed on the fly instead + // of a standard function pointer. The result should be true. + f ( [](int x) { return x > 3; } ); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_LAMBDA 1" >>confdefs.h + + have_cxx11_lambda=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_lambda == xyes; then + HAVE_CXX11_LAMBDA_TRUE= + HAVE_CXX11_LAMBDA_FALSE='#' +else + HAVE_CXX11_LAMBDA_TRUE='#' + HAVE_CXX11_LAMBDA_FALSE= +fi + + + if test "x$have_cxx11_lambda" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 lambda support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 lambda support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_fixed_type_enum=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 fixed type enumeration support" >&5 +printf %s "checking for C++11 fixed type enumeration support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + enum Fruit : int {APPLE=0, ORANGE=1}; + +int +main (void) +{ + + Fruit f = APPLE; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_FIXED_TYPE_ENUM 1" >>confdefs.h + + have_cxx11_fixed_type_enum=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_fixed_type_enum == xyes; then + HAVE_CXX11_FIXED_TYPE_ENUM_TRUE= + HAVE_CXX11_FIXED_TYPE_ENUM_FALSE='#' +else + HAVE_CXX11_FIXED_TYPE_ENUM_TRUE='#' + HAVE_CXX11_FIXED_TYPE_ENUM_FALSE= +fi + + + if test "x$have_cxx11_fixed_type_enum" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 fixed type enumeration support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 fixed type enumeration support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_fixed_type_enum_fwd=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 fixed type enumeration forward declaration support" >&5 +printf %s "checking for C++11 fixed type enumeration forward declaration support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + enum Foo : int; + void func(Foo f) { std::cout << f << std::endl; } + enum Foo : int { FOO0 = 0, FOO1 = 1, FOO2 = 2 }; + +int +main (void) +{ + + func(FOO0); + func(FOO1); + func(FOO2); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_FIXED_TYPE_ENUM_FWD 1" >>confdefs.h + + have_cxx11_fixed_type_enum_fwd=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_fixed_type_enum_fwd == xyes; then + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE= + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE='#' +else + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE='#' + HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE= +fi + + + if test "x$have_cxx11_fixed_type_enum_fwd" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 fixed type enumeration forward declaration support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 fixed type enumeration forward declaration support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_override=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 override keyword support" >&5 +printf %s "checking for C++11 override keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + struct Base { + virtual void f() {} + }; + struct Child : public Base { + virtual void f() override {} + }; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_OVERRIDE 1" >>confdefs.h + + have_cxx11_override=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_override == xyes; then + HAVE_CXX11_OVERRIDE_TRUE= + HAVE_CXX11_OVERRIDE_FALSE='#' +else + HAVE_CXX11_OVERRIDE_TRUE='#' + HAVE_CXX11_OVERRIDE_FALSE= +fi + + + if test "x$have_cxx11_override" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 compiler support the override keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 compiler support the override keyword" >&2;} + have_cxx_all=no +fi + + + have_cxx11_move_constructors=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 move constructor support" >&5 +printf %s "checking for C++11 move constructor support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + class move_constructable_base + { + public: + move_constructable_base() {} + move_constructable_base(move_constructable_base && other) noexcept {} + }; + class move_constructable : public move_constructable_base + { + public: + move_constructable() {} + move_constructable(move_constructable && other) noexcept : move_constructable_base(std::move(other)) {} + }; + +int +main (void) +{ + + move_constructable m1; + move_constructable m2(std::move(m1)); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_MOVE_CONSTRUCTORS 1" >>confdefs.h + + have_cxx11_move_constructors=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_move_constructors == xyes; then + HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE= + HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE='#' +else + HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE='#' + HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE= +fi + + + if test "x$have_cxx11_move_constructors" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 move constructor support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 move constructor support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_deleted_functions=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 deleted functions support" >&5 +printf %s "checking for C++11 deleted functions support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + class Foo + { + Foo(const Foo &) = delete; + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_DELETED_FUNCTIONS 1" >>confdefs.h + + have_cxx11_deleted_functions=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_deleted_functions == xyes; then + HAVE_CXX11_DELETED_FUNCTIONS_TRUE= + HAVE_CXX11_DELETED_FUNCTIONS_FALSE='#' +else + HAVE_CXX11_DELETED_FUNCTIONS_TRUE='#' + HAVE_CXX11_DELETED_FUNCTIONS_FALSE= +fi + + + if test "x$have_cxx11_deleted_functions" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 deleted function support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 deleted function support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_defaulted_functions=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 defaulted functions support" >&5 +printf %s "checking for C++11 defaulted functions support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + class Foo + { + Foo(const Foo &) = default; + ~Foo(); + }; + Foo::~Foo() = default; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_DEFAULTED_FUNCTIONS 1" >>confdefs.h + + have_cxx11_defaulted_functions=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_defaulted_functions == xyes; then + HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE= + HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE='#' +else + HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE='#' + HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE= +fi + + + if test "x$have_cxx11_defaulted_functions" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 defaulted function support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 defaulted function support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_nullptr=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 nullptr support" >&5 +printf %s "checking for C++11 nullptr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + void f(int * pi) {} + void f(double * pd) {} + void f(std::nullptr_t nullp) {} + +int +main (void) +{ + + // would be ambiguous without void f(nullptr_t) + f(nullptr); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_NULLPTR 1" >>confdefs.h + + have_cxx11_nullptr=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_nullptr == xyes; then + HAVE_CXX11_NULLPTR_TRUE= + HAVE_CXX11_NULLPTR_FALSE='#' +else + HAVE_CXX11_NULLPTR_TRUE='#' + HAVE_CXX11_NULLPTR_FALSE= +fi + + + if test "x$have_cxx11_nullptr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 nullptr keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 nullptr keyword" >&2;} + have_cxx_all=no +fi + + + have_cxx11_final=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 'final' keyword support" >&5 +printf %s "checking for C++11 'final' keyword support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + // Test that a function can be declared final. + struct A + { + virtual void foo() final; + }; + + // Test that a struct can be declared final. + struct B final : A + { + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + have_cxx11_final=yes + +else case e in #( + e) + have_cxx11_final=no + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Confirm that you cannot declare a non-virtual function 'final'. + if test "x$have_cxx11_final" != "xno" +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + struct A + { + // Error: non-virtual function cannot be final + void bar() final; + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no + +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + + if test "x$have_cxx11_final" != "xno" +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + struct A + { + virtual void foo() final; + }; + struct B : A + { + // Error: foo cannot be overridden as it's final in A + void foo(); + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no + +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + + if test "x$have_cxx11_final" != "xno" +then : + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + struct A + { + }; + + // struct B is final + struct B final : A + { + }; + + // Error: B is final + struct C : B + { + }; + +int +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + # If this code compiles, 'final' is not working correctly. + have_cxx11_final=no + +else case e in #( + e) + have_cxx11_final=yes + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + + # If the flag is still 'yes' after all the tests, set the #define. + if test "x$have_cxx11_final" = "xyes" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_FINAL 1" >>confdefs.h + + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac +fi + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_final == xyes; then + HAVE_CXX11_FINAL_TRUE= + HAVE_CXX11_FINAL_FALSE='#' +else + HAVE_CXX11_FINAL_TRUE='#' + HAVE_CXX11_FINAL_FALSE= +fi + + + if test "x$have_cxx11_final" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 final keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 final keyword" >&2;} + have_cxx_all=no +fi + + + have_cxx11_decltype=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 decltype support" >&5 +printf %s "checking for C++11 decltype support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + int a; + decltype(a) b; + std::vector vec(10); + for (auto i = decltype(vec.size())(0); i < vec.size(); ++i) + vec[i] += i; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_DECLTYPE 1" >>confdefs.h + + have_cxx11_decltype=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_decltype == xyes; then + HAVE_CXX11_DECLTYPE_TRUE= + HAVE_CXX11_DECLTYPE_FALSE='#' +else + HAVE_CXX11_DECLTYPE_TRUE='#' + HAVE_CXX11_DECLTYPE_FALSE= +fi + + + if test "x$have_cxx11_decltype" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires the C++11 decltype keyword" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires the C++11 decltype keyword" >&2;} + have_cxx_all=no +fi + + + have_cxx11_begin_end=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::begin/end support for arrays" >&5 +printf %s "checking for C++11 std::begin/end support for arrays... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + int array[5] = {3, 1, 5, 2, 4}; + std::sort(std::begin(array), std::end(array)); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_begin_end=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_begin_end" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 std::begin/end support" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 std::begin/end support" >&2;} + have_cxx_all=no +fi + + + have_cxx11_container_erase=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std container erase() functions returning iterators" >&5 +printf %s "checking for C++11 std container erase() functions returning iterators... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + { + std::map m; + m.insert(std::make_pair(1,2)); + std::map::iterator it = m.erase(m.begin()); + } + { + std::set s; + s.insert(1); + std::set::iterator it = s.erase(s.begin()); + } + { + std::multimap m; + m.insert(std::make_pair(1,2)); + std::multimap::iterator it = m.erase(m.begin()); + } + { + std::multiset s; + s.insert(1); + std::multiset::iterator it = s.erase(s.begin()); + } + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_container_erase=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_container_erase" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std container erase() functions returning iterators" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std container erase() functions returning iterators" >&2;} + have_cxx_all=no +fi + + + have_cxx11_container_emplace=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std container emplace() functions" >&5 +printf %s "checking for C++11 std container emplace() functions... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main (void) +{ + + { + std::map m; + m.emplace(1,2); + m.emplace_hint(m.begin(), 0, 3); + } + { + std::set s; + s.emplace(1); + s.emplace_hint(s.begin(), 0); + } + { + std::multimap m; + m.emplace(1,2); + m.emplace_hint(m.begin(), 0, 3); + } + { + std::multiset s; + s.emplace(1); + s.emplace_hint(s.begin(), 0); + } + { + std::vector v; + v.emplace(v.begin(), 0); + v.emplace_back(1); + } + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_container_emplace=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_container_emplace" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std container emplace() functions" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std container emplace() functions" >&2;} + have_cxx_all=no +fi + + + have_cxx11_iota=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::iota algorithm" >&5 +printf %s "checking for C++11 std::iota algorithm... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + std::vector v(10); + std::iota(v.begin(), v.end(), 0); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_iota=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_iota" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::iota" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::iota" >&2;} + have_cxx_all=no +fi + + + have_cxx11_vector_data=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::vector::data() API" >&5 +printf %s "checking for C++11 std::vector::data() API... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + std::vector v(10); + int * begin = v.data(); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_vector_data=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_vector_data" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::vector::data()" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::vector::data()" >&2;} + have_cxx_all=no +fi + + + have_cxx11_shared_ptr=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::shared_ptr support" >&5 +printf %s "checking for C++11 std::shared_ptr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + # Save any original value that CXXFLAGS had + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + std::shared_ptr p1; + std::shared_ptr p2 (new int); + std::shared_ptr p3 (p2); + p3.reset(new int); + p3 = std::make_shared(5); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + have_cxx11_shared_ptr=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else case e in #( + e) + have_cxx11_shared_ptr=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + if test "x$have_cxx11_shared_ptr" = "xyes" +then : + +printf "%s\n" "#define HAVE_CXX11_SHARED_PTR 1" >>confdefs.h + +fi + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_shared_ptr == xyes; then + HAVE_CXX11_SHARED_PTR_TRUE= + HAVE_CXX11_SHARED_PTR_FALSE='#' +else + HAVE_CXX11_SHARED_PTR_TRUE='#' + HAVE_CXX11_SHARED_PTR_FALSE= +fi + + + if test "x$have_cxx11_shared_ptr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::shared_ptr" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::shared_ptr" >&2;} + have_cxx_all=no +fi + + + have_cxx11_rvalue_references=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 rvalue references support" >&5 +printf %s "checking for C++11 rvalue references support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int foo(int && x) { return x; } + int bar() { return 4; } + +int +main (void) +{ + + // Call function that takes an rvalue reference. + foo (bar()); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_RVALUE_REFERENCES 1" >>confdefs.h + + have_cxx11_rvalue_references=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_rvalue_references == xyes; then + HAVE_CXX11_RVALUE_REFERENCES_TRUE= + HAVE_CXX11_RVALUE_REFERENCES_FALSE='#' +else + HAVE_CXX11_RVALUE_REFERENCES_TRUE='#' + HAVE_CXX11_RVALUE_REFERENCES_FALSE= +fi + + + if test "x$have_cxx11_rvalue_references" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for rvalue references" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for rvalue references" >&2;} + have_cxx_all=no +fi + + + have_cxx11_to_string=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::to_string() support" >&5 +printf %s "checking for C++11 std::to_string() support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + // tiny="0.000000". Note: std::to_string(double) is required to produce + // a std::string with the same contents as std::sprintf(buf, "%f", value) + // would produce, given a sufficiently large buf. This is *different* from + // what you get from a std::stringstream using default formatting and + // precision flags, i.e. + // std::ostringstream oss; + // oss << 1.e-40; + // std::string tiny = oss.str(); + // will produce the string "1e-40". + std::string tiny = std::to_string(1.e-40); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_TO_STRING 1" >>confdefs.h + + have_cxx11_to_string=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_to_string == xyes; then + HAVE_CXX11_TO_STRING_TRUE= + HAVE_CXX11_TO_STRING_FALSE='#' +else + HAVE_CXX11_TO_STRING_TRUE='#' + HAVE_CXX11_TO_STRING_FALSE= +fi + + + if test "x$have_cxx11_to_string" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::to_string()" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::to_string()" >&2;} + have_cxx_all=no +fi + + + have_cxx11_constexpr=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 constexpr support" >&5 +printf %s "checking for C++11 constexpr support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + constexpr int multiply (int x, int y) { return x * y; } + +int +main (void) +{ + + // The compiler should compute "val" at compile time. + const int val = multiply(10, 10); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_CONSTEXPR 1" >>confdefs.h + + have_cxx11_constexpr=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_constexpr == xyes; then + HAVE_CXX11_CONSTEXPR_TRUE= + HAVE_CXX11_CONSTEXPR_FALSE='#' +else + HAVE_CXX11_CONSTEXPR_TRUE='#' + HAVE_CXX11_CONSTEXPR_FALSE= +fi + + + if test "x$have_cxx11_constexpr" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for constexpr" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for constexpr" >&2;} + have_cxx_all=no +fi + + + have_cxx11_variadic_templates=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 variadic template support" >&5 +printf %s "checking for C++11 variadic template support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + // Base case + template + T sum(T t) { return t; } + + // Compute sum of arbitrary number of passed parameters. + template + T sum(T t, P ...p) + { + t += sum(p...); + return t; + } + +int +main (void) +{ + + sum(1, 2, 3, 4, 5); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_VARIADIC_TEMPLATES 1" >>confdefs.h + + have_cxx11_variadic_templates=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_variadic_templates == xyes; then + HAVE_CXX11_VARIADIC_TEMPLATES_TRUE= + HAVE_CXX11_VARIADIC_TEMPLATES_FALSE='#' +else + HAVE_CXX11_VARIADIC_TEMPLATES_TRUE='#' + HAVE_CXX11_VARIADIC_TEMPLATES_FALSE= +fi + + + if test "x$have_cxx11_variadic_templates" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for variadic templates" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for variadic templates" >&2;} + have_cxx_all=no +fi + + + have_cxx11_alias_declarations=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 alias declarations support" >&5 +printf %s "checking for C++11 alias declarations support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + template + struct check + { + T t; + }; + + // An alias declaration is like a templated typedef + template + using MyCheck = check; + +int +main (void) +{ + + MyCheck mc; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_CXX11_ALIAS_DECLARATIONS 1" >>confdefs.h + + have_cxx11_alias_declarations=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_alias_declarations == xyes; then + HAVE_CXX11_ALIAS_DECLARATIONS_TRUE= + HAVE_CXX11_ALIAS_DECLARATIONS_FALSE='#' +else + HAVE_CXX11_ALIAS_DECLARATIONS_TRUE='#' + HAVE_CXX11_ALIAS_DECLARATIONS_FALSE= +fi + + + if test "x$have_cxx11_alias_declarations" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for alias declarations" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for alias declarations" >&2;} + have_cxx_all=no +fi + + + have_cxx11_array=no + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::array" >&5 +printf %s "checking for C++11 std::array... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + std::array a; + a[0] = 42.0; + double * begin = a.data(); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_array=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_array" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::array" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::array" >&2;} + have_cxx_all=no +fi + + + have_cxx11_isnan=no + have_cxx11_isinf=no + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isnan" >&5 +printf %s "checking for C++11 std::isnan... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + if (std::isnan(0.0)) + return 1; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_isnan=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isinf" >&5 +printf %s "checking for C++11 std::isinf... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main (void) +{ + + if (std::isinf(0.0)) + return 1; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_isinf=yes + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx11_isnan" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isnan" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isnan" >&2;} + have_cxx_all=no +fi + if test "x$have_cxx11_isinf" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isinf" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isinf" >&2;} + have_cxx_all=no +fi + + + have_cxx17_splicing=no + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + + + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 std::*::merge" >&5 +printf %s "checking for C++17 std::*::merge... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + +int +main (void) +{ + + std::set s1{1}, s2{2}; + std::unordered_set us1{3}, us2{4}; + std::map m1{{5,6}}, m2{{7,8}}; + std::unordered_map um1{{9,10}}, um2{{11,12}}; + s1.merge(std::move(s2)); + us1.merge(std::move(us2)); + m1.merge(std::move(m2)); + um1.merge(std::move(um2)); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx17_splicing=yes + +printf "%s\n" "#define HAVE_CXX17_SPLICING 1" >>confdefs.h + + +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx17_splicing" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh prefers C++17 support for set/map merge" >&5 +printf "%s\n" "$as_me: WARNING: libMesh prefers C++17 support for set/map merge" >&2;} +fi + +fi + if test "$HAVE_TESTED_CXX" = "1" -a "x$have_cxx_all" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Found C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Found C++$CXX_YEAR standard support" >&6;} + if test $acsm_found_cxx -eq 0 +then : + acsm_cxx_version=$CXX_YEAR +fi + acsm_found_cxx=1 +else case e in #( + e) CXX="$acsm_backup_CXX" + CXXCPP="$acsm_backup_CXXCPP" + if test "$HAVE_CXX17" = "0" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Did not find C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Did not find C++$CXX_YEAR standard support" >&6;} +fi ;; +esac +fi + +fi + + CXX_YEAR=14 + if test "20$CXX_YEAR" -le "$acsm_CXX_STD_MAX" -a $acsm_found_cxx -eq 0 +then : + + if test "20$CXX_YEAR" -gt "$acsm_CXX_STD_MIN" +then : + ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + ac_success=no + + + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features by default" >&5 +printf %s "checking whether $CXX supports C++14 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx14+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// 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 && !defined _MSC_VER + +#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 + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_cxx_compile_cxx14=yes +else case e in #( + e) ax_cv_cxx_compile_cxx14=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx14" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx14" >&6; } + if test x$ax_cv_cxx_compile_cxx14 = xyes; then + ac_success=yes + fi + fi + + + + + + + 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}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | sed "$as_sed_sh"` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 +printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -18952,7 +28309,7 @@ namespace cxx11 #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -19073,27 +28430,523 @@ else case e in #( esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; + CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break fi - ac_success=yes + done + if test x$ac_success = xyes; then break fi done fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX14=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++14 support was found" >&6;} + else + HAVE_CXX14=1 + +printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h + + fi + + +else case e in #( + e) ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + ac_success=no + + + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features by default" >&5 +printf %s "checking whether $CXX supports C++14 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx14+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + + + + +// 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 && !defined _MSC_VER + +#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 + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ax_cv_cxx_compile_cxx14=yes +else case e in #( + e) ax_cv_cxx_compile_cxx14=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx14" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx14" >&6; } + if test x$ax_cv_cxx_compile_cxx14 = xyes; then + ac_success=yes + fi + fi + + + + + + 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=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | sed "$as_sed_sh"` + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx14_$switch" | sed "$as_sed_sh"` + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5 printf %s "checking whether $CXX supports C++14 features with $switch... " >&6; } if eval test \${$cachevar+y} @@ -19113,7 +28966,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -19400,7 +29267,7 @@ namespace cxx11 #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -19541,6 +29408,7 @@ printf "%s\n" "$ac_res" >&6; } fi done fi + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -19566,7 +29434,8 @@ printf "%s\n" "#define HAVE_CXX14 1" >>confdefs.h ;; esac fi - if test "$HAVE_CXX14" = "1" -a $acsm_found_cxx -eq 0 + eval "HAVE_TESTED_CXX=\${HAVE_CXX$CXX_YEAR}" + if test "$HAVE_TESTED_CXX" = "1" -a $acsm_found_cxx -eq 0 then : # If nothing fails later we're good to go @@ -21517,332 +31386,8 @@ fi have_cxx11_to_string=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::to_string() support" >&5 -printf %s "checking for C++11 std::to_string() support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - - - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main (void) -{ - - // tiny="0.000000". Note: std::to_string(double) is required to produce - // a std::string with the same contents as std::sprintf(buf, "%f", value) - // would produce, given a sufficiently large buf. This is *different* from - // what you get from a std::stringstream using default formatting and - // precision flags, i.e. - // std::ostringstream oss; - // oss << 1.e-40; - // std::string tiny = oss.str(); - // will produce the string "1e-40". - std::string tiny = std::to_string(1.e-40); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_TO_STRING 1" >>confdefs.h - - have_cxx11_to_string=yes - -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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$have_cxx11_to_string == xyes; then - HAVE_CXX11_TO_STRING_TRUE= - HAVE_CXX11_TO_STRING_FALSE='#' -else - HAVE_CXX11_TO_STRING_TRUE='#' - HAVE_CXX11_TO_STRING_FALSE= -fi - - - if test "x$have_cxx11_to_string" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::to_string()" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::to_string()" >&2;} - have_cxx_all=no -fi - - - have_cxx11_constexpr=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 constexpr support" >&5 -printf %s "checking for C++11 constexpr support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - - - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - constexpr int multiply (int x, int y) { return x * y; } - -int -main (void) -{ - - // The compiler should compute "val" at compile time. - const int val = multiply(10, 10); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_CONSTEXPR 1" >>confdefs.h - - have_cxx11_constexpr=yes - -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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$have_cxx11_constexpr == xyes; then - HAVE_CXX11_CONSTEXPR_TRUE= - HAVE_CXX11_CONSTEXPR_FALSE='#' -else - HAVE_CXX11_CONSTEXPR_TRUE='#' - HAVE_CXX11_CONSTEXPR_FALSE= -fi - - - if test "x$have_cxx11_constexpr" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for constexpr" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for constexpr" >&2;} - have_cxx_all=no -fi - - - have_cxx11_variadic_templates=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 variadic template support" >&5 -printf %s "checking for C++11 variadic template support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - - - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - // Base case - template - T sum(T t) { return t; } - - // Compute sum of arbitrary number of passed parameters. - template - T sum(T t, P ...p) - { - t += sum(p...); - return t; - } - -int -main (void) -{ - - sum(1, 2, 3, 4, 5); - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_VARIADIC_TEMPLATES 1" >>confdefs.h - - have_cxx11_variadic_templates=yes - -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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$have_cxx11_variadic_templates == xyes; then - HAVE_CXX11_VARIADIC_TEMPLATES_TRUE= - HAVE_CXX11_VARIADIC_TEMPLATES_FALSE='#' -else - HAVE_CXX11_VARIADIC_TEMPLATES_TRUE='#' - HAVE_CXX11_VARIADIC_TEMPLATES_FALSE= -fi - - - if test "x$have_cxx11_variadic_templates" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for variadic templates" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for variadic templates" >&2;} - have_cxx_all=no -fi - - - have_cxx11_alias_declarations=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 alias declarations support" >&5 -printf %s "checking for C++11 alias declarations support... " >&6; } - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - - - old_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - template - struct check - { - T t; - }; - - // An alias declaration is like a templated typedef - template - using MyCheck = check; - -int -main (void) -{ - - MyCheck mc; - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - -printf "%s\n" "#define HAVE_CXX11_ALIAS_DECLARATIONS 1" >>confdefs.h - - have_cxx11_alias_declarations=yes - -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - # Reset the flags - CXXFLAGS="$old_CXXFLAGS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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$have_cxx11_alias_declarations == xyes; then - HAVE_CXX11_ALIAS_DECLARATIONS_TRUE= - HAVE_CXX11_ALIAS_DECLARATIONS_FALSE='#' -else - HAVE_CXX11_ALIAS_DECLARATIONS_TRUE='#' - HAVE_CXX11_ALIAS_DECLARATIONS_FALSE= -fi - - - if test "x$have_cxx11_alias_declarations" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for alias declarations" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for alias declarations" >&2;} - have_cxx_all=no -fi - - - have_cxx11_array=no - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::array" >&5 -printf %s "checking for C++11 std::array... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::to_string() support" >&5 +printf %s "checking for C++11 std::to_string() support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -21856,15 +31401,22 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include + #include int main (void) { - std::array a; - a[0] = 42.0; - double * begin = a.data(); + // tiny="0.000000". Note: std::to_string(double) is required to produce + // a std::string with the same contents as std::sprintf(buf, "%f", value) + // would produce, given a sufficiently large buf. This is *different* from + // what you get from a std::stringstream using default formatting and + // precision flags, i.e. + // std::ostringstream oss; + // oss << 1.e-40; + // std::string tiny = oss.str(); + // will produce the string "1e-40". + std::string tiny = std::to_string(1.e-40); ; return 0; @@ -21875,18 +31427,22 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - have_cxx11_array=yes + +printf "%s\n" "#define HAVE_CXX11_TO_STRING 1" >>confdefs.h + + have_cxx11_to_string=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS="$old_CXXFLAGS" + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -21894,17 +31450,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "x$have_cxx11_array" != "xyes" + if test x$have_cxx11_to_string == xyes; then + HAVE_CXX11_TO_STRING_TRUE= + HAVE_CXX11_TO_STRING_FALSE='#' +else + HAVE_CXX11_TO_STRING_TRUE='#' + HAVE_CXX11_TO_STRING_FALSE= +fi + + + if test "x$have_cxx11_to_string" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::array" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::array" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::to_string()" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::to_string()" >&2;} have_cxx_all=no fi - have_cxx11_isnan=no - have_cxx11_isinf=no + have_cxx11_constexpr=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 constexpr support" >&5 +printf %s "checking for C++11 constexpr support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -21915,19 +31481,17 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu old_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isnan" >&5 -printf %s "checking for C++11 std::isnan... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include + constexpr int multiply (int x, int y) { return x * y; } int main (void) { - if (std::isnan(0.0)) - return 1; + // The compiler should compute "val" at compile time. + const int val = multiply(10, 10); ; return 0; @@ -21938,41 +31502,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - have_cxx11_isnan=yes - -else case e in #( - e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isinf" >&5 -printf %s "checking for C++11 std::isinf... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main (void) -{ - - if (std::isinf(0.0)) - return 1; - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : +printf "%s\n" "#define HAVE_CXX11_CONSTEXPR 1" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - have_cxx11_isinf=yes + have_cxx11_constexpr=yes else case e in #( e) @@ -21983,7 +31516,8 @@ esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS="$old_CXXFLAGS" + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -21991,22 +31525,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "x$have_cxx11_isnan" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isnan" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isnan" >&2;} - have_cxx_all=no + if test x$have_cxx11_constexpr == xyes; then + HAVE_CXX11_CONSTEXPR_TRUE= + HAVE_CXX11_CONSTEXPR_FALSE='#' +else + HAVE_CXX11_CONSTEXPR_TRUE='#' + HAVE_CXX11_CONSTEXPR_FALSE= fi - if test "x$have_cxx11_isinf" != "xyes" + + + if test "x$have_cxx11_constexpr" != "xyes" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isinf" >&5 -printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isinf" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for constexpr" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for constexpr" >&2;} have_cxx_all=no fi - have_cxx17_splicing=no + have_cxx11_variadic_templates=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 variadic template support" >&5 +printf %s "checking for C++11 variadic template support... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22017,28 +31556,26 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu old_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 std::*::merge" >&5 -printf %s "checking for C++17 std::*::merge... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include - #include + // Base case + template + T sum(T t) { return t; } + + // Compute sum of arbitrary number of passed parameters. + template + T sum(T t, P ...p) + { + t += sum(p...); + return t; + } int main (void) { - std::set s1{1}, s2{2}; - std::unordered_set us1{3}, us2{4}; - std::map m1{{5,6}}, m2{{7,8}}; - std::unordered_map um1{{9,10}}, um2{{11,12}}; - s1.merge(std::move(s2)); - us1.merge(std::move(us2)); - m1.merge(std::move(m2)); - um1.merge(std::move(um2)); + sum(1, 2, 3, 4, 5); ; return 0; @@ -22049,21 +31586,22 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - have_cxx17_splicing=yes -printf "%s\n" "#define HAVE_CXX17_SPLICING 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX11_VARIADIC_TEMPLATES 1" >>confdefs.h + have_cxx11_variadic_templates=yes else case e in #( e) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXXFLAGS="$old_CXXFLAGS" + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -22071,706 +31609,390 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "x$have_cxx17_splicing" != "xyes" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh prefers C++17 support for set/map merge" >&5 -printf "%s\n" "$as_me: WARNING: libMesh prefers C++17 support for set/map merge" >&2;} -fi - -fi - if test "$HAVE_CXX14" = "1" -a "x$have_cxx_all" = xyes -then : - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Found C++14 standard support" >&5 -printf "%s\n" "$as_me: Found C++14 standard support" >&6;} - if test $acsm_found_cxx -eq 0 -then : - acsm_cxx_version=14 -fi - acsm_found_cxx=1 -else case e in #( - e) CXX="$acsm_backup_CXX" - CXXCPP="$acsm_backup_CXXCPP" - if test "$HAVE_CXX14" = "0" -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Did not find C++14 standard support" >&5 -printf "%s\n" "$as_me: Did not find C++14 standard support" >&6;} -fi ;; -esac -fi - + if test x$have_cxx11_variadic_templates == xyes; then + HAVE_CXX11_VARIADIC_TEMPLATES_TRUE= + HAVE_CXX11_VARIADIC_TEMPLATES_FALSE='#' +else + HAVE_CXX11_VARIADIC_TEMPLATES_TRUE='#' + HAVE_CXX11_VARIADIC_TEMPLATES_FALSE= fi - if test 2011 -le "$acsm_CXX_STD_MAX" -then : - - if test 2011 -gt "$acsm_CXX_STD_MIN" -then : - ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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 - ac_success=no - - cachevar=ax_cv_cxx_compile_cxx11 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 -printf %s "checking whether $CXX supports C++11 features by default... " >&6; } -if eval test \${$cachevar+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; - - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - - - -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval $cachevar=yes -else case e in #( - e) eval $cachevar=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes -then : - ac_success=yes -fi - - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } -if eval test \${$cachevar+y} + if test "x$have_cxx11_variadic_templates" != "xyes" then : - printf %s "(cached) " >&6 -else case e in #( - e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for variadic templates" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for variadic templates" >&2;} + have_cxx_all=no +fi -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. + have_cxx11_alias_declarations=no -#ifndef __cplusplus + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 alias declarations support" >&5 +printf %s "checking for C++11 alias declarations support... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 -#error "This is not a C++ compiler" -#elif __cplusplus < 201103L + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" -#error "This is not a C++11 compiler" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -#else + template + struct check + { + T t; + }; -namespace cxx11 + // An alias declaration is like a templated typedef + template + using MyCheck = check; + +int +main (void) { - namespace test_static_assert - { + MyCheck mc; - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } - namespace test_final_override - { +printf "%s\n" "#define HAVE_CXX11_ALIAS_DECLARATIONS 1" >>confdefs.h - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; + have_cxx11_alias_declarations=yes - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } + # Reset the flags + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_double_right_angle_brackets - { - template < typename T > - struct check {}; + if test x$have_cxx11_alias_declarations == xyes; then + HAVE_CXX11_ALIAS_DECLARATIONS_TRUE= + HAVE_CXX11_ALIAS_DECLARATIONS_FALSE='#' +else + HAVE_CXX11_ALIAS_DECLARATIONS_TRUE='#' + HAVE_CXX11_ALIAS_DECLARATIONS_FALSE= +fi - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - } + if test "x$have_cxx11_alias_declarations" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for alias declarations" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for alias declarations" >&2;} + have_cxx_all=no +fi - namespace test_decltype - { - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } + have_cxx11_array=no - } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::array" >&5 +printf %s "checking for C++11 std::array... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_type_deduction - { - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - template < typename T > - struct is_same - { - static const bool value = true; - }; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } + #include - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } +int +main (void) +{ - } + std::array a; + a[0] = 42.0; + double * begin = a.data(); - namespace test_noexcept - { + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - int f() { return 0; } - int g() noexcept { return 0; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_array=yes - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - } + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_constexpr - { - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } + if test "x$have_cxx11_array" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::array" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::array" >&2;} + have_cxx_all=no +fi - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); + have_cxx11_isnan=no + have_cxx11_isinf=no - } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - namespace test_rvalue_references - { - template < int N > - struct answer - { - static constexpr int value = N; - }; + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isnan" >&5 +printf %s "checking for C++11 std::isnan... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } + #include - } +int +main (void) +{ - namespace test_uniform_initialization - { + if (std::isnan(0.0)) + return 1; - struct test - { - static const int zero {}; - static const int one {1}; - }; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_isnan=yes - } +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - namespace test_lambdas - { + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++11 std::isinf" >&5 +printf %s "checking for C++11 std::isinf... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } + #include - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } +int +main (void) +{ - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } + if (std::isinf(0.0)) + return 1; - } + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : - namespace test_variadic_templates - { + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx11_isinf=yes - template - struct sum; +else case e in #( + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + if test "x$have_cxx11_isnan" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isnan" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isnan" >&2;} + have_cxx_all=no +fi + if test "x$have_cxx11_isinf" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh requires C++11 support for std::isinf" >&5 +printf "%s\n" "$as_me: WARNING: libMesh requires C++11 support for std::isinf" >&2;} + have_cxx_all=no +fi - } - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { + have_cxx17_splicing=no - struct foo {}; + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 - template - using member = typename T::member_type; - template - void func(...) {} + old_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $libmesh_CXXFLAGS" - template - void func(member*) {} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++17 std::*::merge" >&5 +printf %s "checking for C++17 std::*::merge... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - void test(); + #include + #include + #include + #include - void test() { func(0); } +int +main (void) +{ - } + std::set s1{1}, s2{2}; + std::unordered_set us1{3}, us2{4}; + std::map m1{{5,6}}, m2{{7,8}}; + std::unordered_map um1{{9,10}}, um2{{11,12}}; + s1.merge(std::move(s2)); + us1.merge(std::move(us2)); + m1.merge(std::move(m2)); + um1.merge(std::move(um2)); -} // namespace cxx11 + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : -#endif // __cplusplus >= 201103L + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_cxx17_splicing=yes +printf "%s\n" "#define HAVE_CXX17_SPLICING 1" >>confdefs.h -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - eval $cachevar=yes else case e in #( - e) eval $cachevar=no ;; + e) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; + + CXXFLAGS="$old_CXXFLAGS" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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$have_cxx17_splicing" != "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libMesh prefers C++17 support for set/map merge" >&5 +printf "%s\n" "$as_me: WARNING: libMesh prefers C++17 support for set/map merge" >&2;} +fi + +fi + if test "$HAVE_TESTED_CXX" = "1" -a "x$have_cxx_all" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Found C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Found C++$CXX_YEAR standard support" >&6;} + if test $acsm_found_cxx -eq 0 +then : + acsm_cxx_version=$CXX_YEAR +fi + acsm_found_cxx=1 +else case e in #( + e) CXX="$acsm_backup_CXX" + CXXCPP="$acsm_backup_CXXCPP" + if test "$HAVE_CXX17" = "0" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Did not find C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Did not find C++$CXX_YEAR standard support" >&6;} +fi ;; esac fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi + +fi + + CXX_YEAR=11 + if test "20$CXX_YEAR" -le "$acsm_CXX_STD_MAX" -a $acsm_found_cxx -eq 0 +then : + + if test "20$CXX_YEAR" -gt "$acsm_CXX_STD_MIN" +then : + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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 + ac_success=no + 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=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } -if eval test \${$cachevar+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 +printf %s "checking whether $CXX supports C++11 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx11+y} then : printf %s "(cached) " >&6 else case e in #( - e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22781,7 +32003,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -23063,72 +32299,44 @@ namespace cxx11 _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - eval $cachevar=yes + ax_cv_cxx_compile_cxx11=yes else case e in #( - e) eval $cachevar=no ;; + e) ax_cv_cxx_compile_cxx11=no ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -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_cxx11_required = xtrue; then - if test x$ac_success = xno; then - as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx11" >&6; } + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes fi fi - if test x$ac_success = xno; then - HAVE_CXX11=0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 -printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} - else - HAVE_CXX11=1 -printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h - fi -else case e in #( - e) 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' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_success=no - cachevar=ax_cv_cxx_compile_cxx11 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 -printf %s "checking whether $CXX supports C++11 features by default... " >&6; } + + 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}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | sed "$as_sed_sh"` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval test \${$cachevar+y} then : printf %s "(cached) " >&6 else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext + e) ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -23139,7 +32347,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -23426,30 +32648,69 @@ else case e in #( e) eval $cachevar=no ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" ;; esac fi eval ac_res=\$$cachevar { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes -then : - ac_success=yes -fi + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +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_cxx11_required = xtrue; then if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | sed "$as_sed_sh"` - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 -printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } -if eval test \${$cachevar+y} + 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_CXX11=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} + else + HAVE_CXX11=1 + +printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h + + fi + + +else case e in #( + e) 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' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + + + if test x$ac_success = xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 +printf %s "checking whether $CXX supports C++11 features by default... " >&6; } +if test ${ax_cv_cxx_compile_cxx11+y} then : printf %s "(cached) " >&6 else case e in #( - e) ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -23460,7 +32721,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -23742,33 +33017,35 @@ namespace cxx11 _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - eval $cachevar=yes + ax_cv_cxx_compile_cxx11=yes else case e in #( - e) eval $cachevar=no ;; + e) ax_cv_cxx_compile_cxx11=no ;; esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CXX="$ac_save_CXX" ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi -eval ac_res=\$$cachevar - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 +printf "%s\n" "$ax_cv_cxx_compile_cxx11" >&6; } + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes + fi fi + + + + + 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=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | sed "$as_sed_sh"` + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_${switch}_MSVC" | sed "$as_sed_sh"` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | sed "$as_sed_sh"` + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval test \${$cachevar+y} @@ -23788,7 +33065,21 @@ else case e in #( #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +// +// The value __cplusplus ought to have is available in _MSVC_LANG since +// Visual Studio 2015 Update 3: +// +// https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros +// +// This was also the first MSVC version to support C++14 so we can't use the +// value of either __cplusplus or _MSVC_LANG to quickly rule out MSVC having +// C++11 or C++14 support, but we can check _MSVC_LANG for C++17 and later. +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -24096,6 +33387,7 @@ printf "%s\n" "$ac_res" >&6; } fi done fi + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -24121,7 +33413,8 @@ printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h ;; esac fi - if test "$HAVE_CXX11" = "1" -a $acsm_found_cxx -eq 0 + eval "HAVE_TESTED_CXX=\${HAVE_CXX$CXX_YEAR}" + if test "$HAVE_TESTED_CXX" = "1" -a $acsm_found_cxx -eq 0 then : # If nothing fails later we're good to go @@ -26633,29 +35926,30 @@ printf "%s\n" "$as_me: WARNING: libMesh prefers C++17 support for set/map merge" fi fi - if test "$HAVE_CXX11" = "1" -a "x$have_cxx_all" = xyes + if test "$HAVE_TESTED_CXX" = "1" -a "x$have_cxx_all" = xyes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Found C++11 standard support" >&5 -printf "%s\n" "$as_me: Found C++11 standard support" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Found C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Found C++$CXX_YEAR standard support" >&6;} if test $acsm_found_cxx -eq 0 then : - acsm_cxx_version=11 + acsm_cxx_version=$CXX_YEAR fi acsm_found_cxx=1 else case e in #( e) CXX="$acsm_backup_CXX" CXXCPP="$acsm_backup_CXXCPP" - if test "$HAVE_CXX11" = "0" + if test "$HAVE_CXX17" = "0" then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Did not find C++11 standard support" >&5 -printf "%s\n" "$as_me: Did not find C++11 standard support" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Did not find C++$CXX_YEAR standard support" >&5 +printf "%s\n" "$as_me: Did not find C++$CXX_YEAR standard support" >&6;} fi ;; esac fi fi + if test "$acsm_found_cxx" = "1" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using support for C++$acsm_cxx_version standard" >&5 @@ -64426,6 +73720,182 @@ if test -z "${HAVE_CXX11_ALIAS_DECLARATIONS_TRUE}" && test -z "${HAVE_CXX11_ALIA as_fn_error $? "conditional \"HAVE_CXX11_ALIAS_DECLARATIONS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_CXX11_AUTO_TRUE}" && test -z "${HAVE_CXX11_AUTO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_AUTO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_RANGEFOR_TRUE}" && test -z "${HAVE_CXX11_RANGEFOR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_RANGEFOR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_INITIALIZER_LIST_TRUE}" && test -z "${HAVE_CXX11_INITIALIZER_LIST_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_INITIALIZER_LIST\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_UNIQUE_PTR_TRUE}" && test -z "${HAVE_CXX11_UNIQUE_PTR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_UNIQUE_PTR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE}" && test -z "${HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_MAKE_UNIQUE_WORKAROUND\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_TUPLE_TRUE}" && test -z "${HAVE_CXX11_TUPLE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_TUPLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_LAMBDA_TRUE}" && test -z "${HAVE_CXX11_LAMBDA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_LAMBDA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_FIXED_TYPE_ENUM_TRUE}" && test -z "${HAVE_CXX11_FIXED_TYPE_ENUM_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_FIXED_TYPE_ENUM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE}" && test -z "${HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_FIXED_TYPE_ENUM_FWD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_OVERRIDE_TRUE}" && test -z "${HAVE_CXX11_OVERRIDE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_OVERRIDE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE}" && test -z "${HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_MOVE_CONSTRUCTORS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_DELETED_FUNCTIONS_TRUE}" && test -z "${HAVE_CXX11_DELETED_FUNCTIONS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_DELETED_FUNCTIONS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE}" && test -z "${HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_DEFAULTED_FUNCTIONS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_NULLPTR_TRUE}" && test -z "${HAVE_CXX11_NULLPTR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_NULLPTR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_FINAL_TRUE}" && test -z "${HAVE_CXX11_FINAL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_FINAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_DECLTYPE_TRUE}" && test -z "${HAVE_CXX11_DECLTYPE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_DECLTYPE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_SHARED_PTR_TRUE}" && test -z "${HAVE_CXX11_SHARED_PTR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_SHARED_PTR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_RVALUE_REFERENCES_TRUE}" && test -z "${HAVE_CXX11_RVALUE_REFERENCES_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_RVALUE_REFERENCES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_TO_STRING_TRUE}" && test -z "${HAVE_CXX11_TO_STRING_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_TO_STRING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_CONSTEXPR_TRUE}" && test -z "${HAVE_CXX11_CONSTEXPR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_CONSTEXPR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_VARIADIC_TEMPLATES_TRUE}" && test -z "${HAVE_CXX11_VARIADIC_TEMPLATES_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_VARIADIC_TEMPLATES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_ALIAS_DECLARATIONS_TRUE}" && test -z "${HAVE_CXX11_ALIAS_DECLARATIONS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_ALIAS_DECLARATIONS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_AUTO_TRUE}" && test -z "${HAVE_CXX11_AUTO_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_AUTO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_RANGEFOR_TRUE}" && test -z "${HAVE_CXX11_RANGEFOR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_RANGEFOR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_INITIALIZER_LIST_TRUE}" && test -z "${HAVE_CXX11_INITIALIZER_LIST_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_INITIALIZER_LIST\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_UNIQUE_PTR_TRUE}" && test -z "${HAVE_CXX11_UNIQUE_PTR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_UNIQUE_PTR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_TRUE}" && test -z "${HAVE_CXX11_MAKE_UNIQUE_WORKAROUND_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_MAKE_UNIQUE_WORKAROUND\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_TUPLE_TRUE}" && test -z "${HAVE_CXX11_TUPLE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_TUPLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_LAMBDA_TRUE}" && test -z "${HAVE_CXX11_LAMBDA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_LAMBDA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_FIXED_TYPE_ENUM_TRUE}" && test -z "${HAVE_CXX11_FIXED_TYPE_ENUM_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_FIXED_TYPE_ENUM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_FIXED_TYPE_ENUM_FWD_TRUE}" && test -z "${HAVE_CXX11_FIXED_TYPE_ENUM_FWD_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_FIXED_TYPE_ENUM_FWD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_OVERRIDE_TRUE}" && test -z "${HAVE_CXX11_OVERRIDE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_OVERRIDE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_MOVE_CONSTRUCTORS_TRUE}" && test -z "${HAVE_CXX11_MOVE_CONSTRUCTORS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_MOVE_CONSTRUCTORS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_DELETED_FUNCTIONS_TRUE}" && test -z "${HAVE_CXX11_DELETED_FUNCTIONS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_DELETED_FUNCTIONS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_DEFAULTED_FUNCTIONS_TRUE}" && test -z "${HAVE_CXX11_DEFAULTED_FUNCTIONS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_DEFAULTED_FUNCTIONS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_NULLPTR_TRUE}" && test -z "${HAVE_CXX11_NULLPTR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_NULLPTR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_FINAL_TRUE}" && test -z "${HAVE_CXX11_FINAL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_FINAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_DECLTYPE_TRUE}" && test -z "${HAVE_CXX11_DECLTYPE_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_DECLTYPE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_SHARED_PTR_TRUE}" && test -z "${HAVE_CXX11_SHARED_PTR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_SHARED_PTR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_RVALUE_REFERENCES_TRUE}" && test -z "${HAVE_CXX11_RVALUE_REFERENCES_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_RVALUE_REFERENCES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_TO_STRING_TRUE}" && test -z "${HAVE_CXX11_TO_STRING_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_TO_STRING\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_CONSTEXPR_TRUE}" && test -z "${HAVE_CXX11_CONSTEXPR_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_CONSTEXPR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_VARIADIC_TEMPLATES_TRUE}" && test -z "${HAVE_CXX11_VARIADIC_TEMPLATES_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_VARIADIC_TEMPLATES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_CXX11_ALIAS_DECLARATIONS_TRUE}" && test -z "${HAVE_CXX11_ALIAS_DECLARATIONS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_CXX11_ALIAS_DECLARATIONS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ACSM_ENABLE_GLIBCXX_DEBUGGING_TRUE}" && test -z "${ACSM_ENABLE_GLIBCXX_DEBUGGING_FALSE}"; then as_fn_error $? "conditional \"ACSM_ENABLE_GLIBCXX_DEBUGGING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/configure.ac b/configure.ac index b21b712414..acc7b706db 100644 --- a/configure.ac +++ b/configure.ac @@ -175,7 +175,7 @@ AS_IF([test "x$enablemarch" != "xno"], # standards level. Adds the required flag to CXXFLAGS if # one is found. Exits if no acceptable flag is found. # -------------------------------------------------------------- -ACSM_CXX_COMPILER_STANDARD([2017], [2017]) +ACSM_CXX_COMPILER_STANDARD([2017], [2017], [defaultnoext]) # -------------------------------------------------------------- # See compiler.m4 for the definition of this function. It uses the diff --git a/contrib/Makefile.in b/contrib/Makefile.in index 7d6f7c95c7..eedeba8191 100644 --- a/contrib/Makefile.in +++ b/contrib/Makefile.in @@ -591,6 +591,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/capnproto/Makefile.in b/contrib/capnproto/Makefile.in index 1d08053806..4076a03dd0 100644 --- a/contrib/capnproto/Makefile.in +++ b/contrib/capnproto/Makefile.in @@ -445,6 +445,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/eigen/gitshim/Makefile.in b/contrib/eigen/gitshim/Makefile.in index de71e03478..c9e55dab0f 100644 --- a/contrib/eigen/gitshim/Makefile.in +++ b/contrib/eigen/gitshim/Makefile.in @@ -329,6 +329,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/exodusii/5.22b/exodus/Makefile.in b/contrib/exodusii/5.22b/exodus/Makefile.in index f07241859d..b6bf6a7bbd 100644 --- a/contrib/exodusii/5.22b/exodus/Makefile.in +++ b/contrib/exodusii/5.22b/exodus/Makefile.in @@ -3312,6 +3312,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/exodusii/5.22b/nemesis/Makefile.in b/contrib/exodusii/5.22b/nemesis/Makefile.in index 9ba2f68d3b..6b5d1be622 100644 --- a/contrib/exodusii/5.22b/nemesis/Makefile.in +++ b/contrib/exodusii/5.22b/nemesis/Makefile.in @@ -391,6 +391,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/exodusii/Lib/Makefile.in b/contrib/exodusii/Lib/Makefile.in index b1c218f7e2..7d62c34f08 100644 --- a/contrib/exodusii/Lib/Makefile.in +++ b/contrib/exodusii/Lib/Makefile.in @@ -1947,6 +1947,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/exodusii/v8.11/exodus/Makefile.in b/contrib/exodusii/v8.11/exodus/Makefile.in index 6005a69a7f..3e6d824102 100644 --- a/contrib/exodusii/v8.11/exodus/Makefile.in +++ b/contrib/exodusii/v8.11/exodus/Makefile.in @@ -4240,6 +4240,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/exodusii/v8.11/nemesis/Makefile.in b/contrib/exodusii/v8.11/nemesis/Makefile.in index c69f68a4b8..79921e7f74 100644 --- a/contrib/exodusii/v8.11/nemesis/Makefile.in +++ b/contrib/exodusii/v8.11/nemesis/Makefile.in @@ -401,6 +401,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/fparser/Makefile.in b/contrib/fparser/Makefile.in index e0b77a0347..d264a2a434 100644 --- a/contrib/fparser/Makefile.in +++ b/contrib/fparser/Makefile.in @@ -859,6 +859,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/fparser/extrasrc/Makefile.in b/contrib/fparser/extrasrc/Makefile.in index 8b762913b0..62c2c80e5f 100644 --- a/contrib/fparser/extrasrc/Makefile.in +++ b/contrib/fparser/extrasrc/Makefile.in @@ -331,6 +331,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/gmv/Makefile.in b/contrib/gmv/Makefile.in index b915fa1559..9655b87903 100644 --- a/contrib/gmv/Makefile.in +++ b/contrib/gmv/Makefile.in @@ -386,6 +386,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/gzstream/Makefile.in b/contrib/gzstream/Makefile.in index 674ae197c8..076149d8ea 100644 --- a/contrib/gzstream/Makefile.in +++ b/contrib/gzstream/Makefile.in @@ -438,6 +438,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/laspack/Makefile.in b/contrib/laspack/Makefile.in index a05bfab6fa..6fd4bc0490 100644 --- a/contrib/laspack/Makefile.in +++ b/contrib/laspack/Makefile.in @@ -496,6 +496,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/libHilbert/Makefile.in b/contrib/libHilbert/Makefile.in index fe6e66d068..611d9a259d 100644 --- a/contrib/libHilbert/Makefile.in +++ b/contrib/libHilbert/Makefile.in @@ -469,6 +469,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/metis/Makefile.in b/contrib/metis/Makefile.in index 23225d9323..cb13742cfb 100644 --- a/contrib/metis/Makefile.in +++ b/contrib/metis/Makefile.in @@ -1013,6 +1013,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/nanoflann/Makefile.in b/contrib/nanoflann/Makefile.in index 1150ac74a8..e7059d4eeb 100644 --- a/contrib/nanoflann/Makefile.in +++ b/contrib/nanoflann/Makefile.in @@ -435,6 +435,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/nemesis/Lib/Makefile.in b/contrib/nemesis/Lib/Makefile.in index ddcc07e895..d766a0ebe3 100644 --- a/contrib/nemesis/Lib/Makefile.in +++ b/contrib/nemesis/Lib/Makefile.in @@ -781,6 +781,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/netgen/Makefile.in b/contrib/netgen/Makefile.in index ccc504df38..f25afec5f7 100644 --- a/contrib/netgen/Makefile.in +++ b/contrib/netgen/Makefile.in @@ -333,6 +333,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/parmetis/Makefile.in b/contrib/parmetis/Makefile.in index 278e5cc0e0..a48468ed3a 100644 --- a/contrib/parmetis/Makefile.in +++ b/contrib/parmetis/Makefile.in @@ -847,6 +847,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/poly2tri/modified/Makefile.in b/contrib/poly2tri/modified/Makefile.in index 27d457d4f7..f37e5c5cf4 100644 --- a/contrib/poly2tri/modified/Makefile.in +++ b/contrib/poly2tri/modified/Makefile.in @@ -533,6 +533,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/qhull/Makefile.in b/contrib/qhull/Makefile.in index 7f7d10abc7..373ece2ec3 100644 --- a/contrib/qhull/Makefile.in +++ b/contrib/qhull/Makefile.in @@ -309,6 +309,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/sfcurves/Makefile.in b/contrib/sfcurves/Makefile.in index bfd13d2427..072b519dd2 100644 --- a/contrib/sfcurves/Makefile.in +++ b/contrib/sfcurves/Makefile.in @@ -406,6 +406,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/tecplot/binary/Makefile.in b/contrib/tecplot/binary/Makefile.in index 74ab99c5e0..d0c555212d 100644 --- a/contrib/tecplot/binary/Makefile.in +++ b/contrib/tecplot/binary/Makefile.in @@ -376,6 +376,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/tecplot/tecio/Makefile.in b/contrib/tecplot/tecio/Makefile.in index 58664370d0..31291f2fb4 100644 --- a/contrib/tecplot/tecio/Makefile.in +++ b/contrib/tecplot/tecio/Makefile.in @@ -615,6 +615,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/tetgen/Makefile.in b/contrib/tetgen/Makefile.in index 35b0d5a124..879845cc2c 100644 --- a/contrib/tetgen/Makefile.in +++ b/contrib/tetgen/Makefile.in @@ -421,6 +421,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/contrib/triangle/Makefile.in b/contrib/triangle/Makefile.in index ccd3ac9396..52c9b889a9 100644 --- a/contrib/triangle/Makefile.in +++ b/contrib/triangle/Makefile.in @@ -416,6 +416,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/doc/Makefile.in b/doc/Makefile.in index f2ed655c0d..be716b953a 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -339,6 +339,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/doc/html/Makefile.in b/doc/html/Makefile.in index a66b785523..e8c4ad1507 100644 --- a/doc/html/Makefile.in +++ b/doc/html/Makefile.in @@ -299,6 +299,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/Makefile.in b/examples/Makefile.in index 568a1380e9..0af57ba13b 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -367,6 +367,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adaptivity/adaptivity_ex1/Makefile.in b/examples/adaptivity/adaptivity_ex1/Makefile.in index c56e6b7941..4ca8177c27 100644 --- a/examples/adaptivity/adaptivity_ex1/Makefile.in +++ b/examples/adaptivity/adaptivity_ex1/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adaptivity/adaptivity_ex2/Makefile.in b/examples/adaptivity/adaptivity_ex2/Makefile.in index 106bdbf139..571a7535b4 100644 --- a/examples/adaptivity/adaptivity_ex2/Makefile.in +++ b/examples/adaptivity/adaptivity_ex2/Makefile.in @@ -476,6 +476,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adaptivity/adaptivity_ex3/Makefile.in b/examples/adaptivity/adaptivity_ex3/Makefile.in index 4dbf2f22d0..ff126ad9be 100644 --- a/examples/adaptivity/adaptivity_ex3/Makefile.in +++ b/examples/adaptivity/adaptivity_ex3/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adaptivity/adaptivity_ex4/Makefile.in b/examples/adaptivity/adaptivity_ex4/Makefile.in index cd351786c3..021dba8790 100644 --- a/examples/adaptivity/adaptivity_ex4/Makefile.in +++ b/examples/adaptivity/adaptivity_ex4/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adaptivity/adaptivity_ex5/Makefile.in b/examples/adaptivity/adaptivity_ex5/Makefile.in index a0de69d4df..606ddddeaf 100644 --- a/examples/adaptivity/adaptivity_ex5/Makefile.in +++ b/examples/adaptivity/adaptivity_ex5/Makefile.in @@ -472,6 +472,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adjoints/adjoints_ex1/Makefile.in b/examples/adjoints/adjoints_ex1/Makefile.in index df2d9e2d86..8b1c16c3c1 100644 --- a/examples/adjoints/adjoints_ex1/Makefile.in +++ b/examples/adjoints/adjoints_ex1/Makefile.in @@ -551,6 +551,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adjoints/adjoints_ex2/Makefile.in b/examples/adjoints/adjoints_ex2/Makefile.in index aa9d5b7cfc..c40fa8a216 100644 --- a/examples/adjoints/adjoints_ex2/Makefile.in +++ b/examples/adjoints/adjoints_ex2/Makefile.in @@ -519,6 +519,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adjoints/adjoints_ex3/Makefile.in b/examples/adjoints/adjoints_ex3/Makefile.in index 7cf44423c8..226cd9b848 100644 --- a/examples/adjoints/adjoints_ex3/Makefile.in +++ b/examples/adjoints/adjoints_ex3/Makefile.in @@ -554,6 +554,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adjoints/adjoints_ex4/Makefile.in b/examples/adjoints/adjoints_ex4/Makefile.in index 364f2400ef..5d32a0db4c 100644 --- a/examples/adjoints/adjoints_ex4/Makefile.in +++ b/examples/adjoints/adjoints_ex4/Makefile.in @@ -554,6 +554,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adjoints/adjoints_ex5/Makefile.in b/examples/adjoints/adjoints_ex5/Makefile.in index 9764aa1694..ff7888310e 100644 --- a/examples/adjoints/adjoints_ex5/Makefile.in +++ b/examples/adjoints/adjoints_ex5/Makefile.in @@ -554,6 +554,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adjoints/adjoints_ex6/Makefile.in b/examples/adjoints/adjoints_ex6/Makefile.in index e237b4d506..ed6f6e5589 100644 --- a/examples/adjoints/adjoints_ex6/Makefile.in +++ b/examples/adjoints/adjoints_ex6/Makefile.in @@ -519,6 +519,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/adjoints/adjoints_ex7/Makefile.in b/examples/adjoints/adjoints_ex7/Makefile.in index b2daa9ff71..ce63f04fa3 100644 --- a/examples/adjoints/adjoints_ex7/Makefile.in +++ b/examples/adjoints/adjoints_ex7/Makefile.in @@ -569,6 +569,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/eigenproblems/eigenproblems_ex1/Makefile.in b/examples/eigenproblems/eigenproblems_ex1/Makefile.in index 8bc67e7970..5679d9ab4b 100644 --- a/examples/eigenproblems/eigenproblems_ex1/Makefile.in +++ b/examples/eigenproblems/eigenproblems_ex1/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/eigenproblems/eigenproblems_ex2/Makefile.in b/examples/eigenproblems/eigenproblems_ex2/Makefile.in index 07cf9a0891..893d075752 100644 --- a/examples/eigenproblems/eigenproblems_ex2/Makefile.in +++ b/examples/eigenproblems/eigenproblems_ex2/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/eigenproblems/eigenproblems_ex3/Makefile.in b/examples/eigenproblems/eigenproblems_ex3/Makefile.in index c13acfa547..10f4f2524f 100644 --- a/examples/eigenproblems/eigenproblems_ex3/Makefile.in +++ b/examples/eigenproblems/eigenproblems_ex3/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/eigenproblems/eigenproblems_ex4/Makefile.in b/examples/eigenproblems/eigenproblems_ex4/Makefile.in index 8384ea08c0..7256d0fb70 100644 --- a/examples/eigenproblems/eigenproblems_ex4/Makefile.in +++ b/examples/eigenproblems/eigenproblems_ex4/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/fem_system/fem_system_ex1/Makefile.in b/examples/fem_system/fem_system_ex1/Makefile.in index 71db1c3f98..64d7c0944c 100644 --- a/examples/fem_system/fem_system_ex1/Makefile.in +++ b/examples/fem_system/fem_system_ex1/Makefile.in @@ -491,6 +491,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/fem_system/fem_system_ex2/Makefile.in b/examples/fem_system/fem_system_ex2/Makefile.in index 96fe9869bc..258ea038a7 100644 --- a/examples/fem_system/fem_system_ex2/Makefile.in +++ b/examples/fem_system/fem_system_ex2/Makefile.in @@ -506,6 +506,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/fem_system/fem_system_ex3/Makefile.in b/examples/fem_system/fem_system_ex3/Makefile.in index 03cd2f4d42..3ac9173e07 100644 --- a/examples/fem_system/fem_system_ex3/Makefile.in +++ b/examples/fem_system/fem_system_ex3/Makefile.in @@ -491,6 +491,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/fem_system/fem_system_ex4/Makefile.in b/examples/fem_system/fem_system_ex4/Makefile.in index cb2e889a09..7bc0afdd27 100644 --- a/examples/fem_system/fem_system_ex4/Makefile.in +++ b/examples/fem_system/fem_system_ex4/Makefile.in @@ -491,6 +491,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/fem_system/fem_system_ex5/Makefile.in b/examples/fem_system/fem_system_ex5/Makefile.in index 2defbd6612..a750a85cd2 100644 --- a/examples/fem_system/fem_system_ex5/Makefile.in +++ b/examples/fem_system/fem_system_ex5/Makefile.in @@ -506,6 +506,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/introduction/introduction_ex1/Makefile.in b/examples/introduction/introduction_ex1/Makefile.in index e3cdc45755..059aca524c 100644 --- a/examples/introduction/introduction_ex1/Makefile.in +++ b/examples/introduction/introduction_ex1/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/introduction/introduction_ex2/Makefile.in b/examples/introduction/introduction_ex2/Makefile.in index 9c3ae93a66..5eafbd2ea6 100644 --- a/examples/introduction/introduction_ex2/Makefile.in +++ b/examples/introduction/introduction_ex2/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/introduction/introduction_ex3/Makefile.in b/examples/introduction/introduction_ex3/Makefile.in index f224f8da6c..b198a35977 100644 --- a/examples/introduction/introduction_ex3/Makefile.in +++ b/examples/introduction/introduction_ex3/Makefile.in @@ -472,6 +472,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/introduction/introduction_ex4/Makefile.in b/examples/introduction/introduction_ex4/Makefile.in index 39a71407ec..9b91bf2376 100644 --- a/examples/introduction/introduction_ex4/Makefile.in +++ b/examples/introduction/introduction_ex4/Makefile.in @@ -472,6 +472,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/introduction/introduction_ex5/Makefile.in b/examples/introduction/introduction_ex5/Makefile.in index 68ad7c9823..167e8fe236 100644 --- a/examples/introduction/introduction_ex5/Makefile.in +++ b/examples/introduction/introduction_ex5/Makefile.in @@ -472,6 +472,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex1/Makefile.in b/examples/miscellaneous/miscellaneous_ex1/Makefile.in index 761ebe541d..69192044fc 100644 --- a/examples/miscellaneous/miscellaneous_ex1/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex1/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex10/Makefile.in b/examples/miscellaneous/miscellaneous_ex10/Makefile.in index 4a48c89580..69e9b1ea12 100644 --- a/examples/miscellaneous/miscellaneous_ex10/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex10/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex11/Makefile.in b/examples/miscellaneous/miscellaneous_ex11/Makefile.in index 5cdfdea4a5..0659c61e95 100644 --- a/examples/miscellaneous/miscellaneous_ex11/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex11/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex12/Makefile.in b/examples/miscellaneous/miscellaneous_ex12/Makefile.in index efa7618228..b637045915 100644 --- a/examples/miscellaneous/miscellaneous_ex12/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex12/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex13/Makefile.in b/examples/miscellaneous/miscellaneous_ex13/Makefile.in index 5720b6d82a..24d2aa8f36 100644 --- a/examples/miscellaneous/miscellaneous_ex13/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex13/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex14/Makefile.in b/examples/miscellaneous/miscellaneous_ex14/Makefile.in index bf4f05bc69..c8b6792997 100644 --- a/examples/miscellaneous/miscellaneous_ex14/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex14/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex15/Makefile.in b/examples/miscellaneous/miscellaneous_ex15/Makefile.in index 86cd52712e..602253abee 100644 --- a/examples/miscellaneous/miscellaneous_ex15/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex15/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex16/Makefile.in b/examples/miscellaneous/miscellaneous_ex16/Makefile.in index c8663f838e..e2ea831a5d 100644 --- a/examples/miscellaneous/miscellaneous_ex16/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex16/Makefile.in @@ -473,6 +473,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex17/Makefile.in b/examples/miscellaneous/miscellaneous_ex17/Makefile.in index e5bd22b699..947fd470e8 100644 --- a/examples/miscellaneous/miscellaneous_ex17/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex17/Makefile.in @@ -472,6 +472,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex2/Makefile.in b/examples/miscellaneous/miscellaneous_ex2/Makefile.in index eb69f30b24..ebf7c0de30 100644 --- a/examples/miscellaneous/miscellaneous_ex2/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex2/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex3/Makefile.in b/examples/miscellaneous/miscellaneous_ex3/Makefile.in index 3f522f2bf9..ce3a6c5eef 100644 --- a/examples/miscellaneous/miscellaneous_ex3/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex3/Makefile.in @@ -462,6 +462,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex4/Makefile.in b/examples/miscellaneous/miscellaneous_ex4/Makefile.in index 5d6c817d11..cf769d1eaa 100644 --- a/examples/miscellaneous/miscellaneous_ex4/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex4/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex5/Makefile.in b/examples/miscellaneous/miscellaneous_ex5/Makefile.in index 6037796613..86439fbf80 100644 --- a/examples/miscellaneous/miscellaneous_ex5/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex5/Makefile.in @@ -471,6 +471,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex6/Makefile.in b/examples/miscellaneous/miscellaneous_ex6/Makefile.in index 2da2618a27..03b75b22e4 100644 --- a/examples/miscellaneous/miscellaneous_ex6/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex6/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex7/Makefile.in b/examples/miscellaneous/miscellaneous_ex7/Makefile.in index 0286c8db8f..fc6c3bb2c1 100644 --- a/examples/miscellaneous/miscellaneous_ex7/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex7/Makefile.in @@ -500,6 +500,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex8/Makefile.in b/examples/miscellaneous/miscellaneous_ex8/Makefile.in index 8fd57091f3..9a5d763d11 100644 --- a/examples/miscellaneous/miscellaneous_ex8/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex8/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/miscellaneous/miscellaneous_ex9/Makefile.in b/examples/miscellaneous/miscellaneous_ex9/Makefile.in index 24605988a3..39491ee14c 100644 --- a/examples/miscellaneous/miscellaneous_ex9/Makefile.in +++ b/examples/miscellaneous/miscellaneous_ex9/Makefile.in @@ -497,6 +497,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/optimization/optimization_ex1/Makefile.in b/examples/optimization/optimization_ex1/Makefile.in index d7f19bfd2f..19e8b21b02 100644 --- a/examples/optimization/optimization_ex1/Makefile.in +++ b/examples/optimization/optimization_ex1/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/optimization/optimization_ex2/Makefile.in b/examples/optimization/optimization_ex2/Makefile.in index 8ce186e518..58379f7426 100644 --- a/examples/optimization/optimization_ex2/Makefile.in +++ b/examples/optimization/optimization_ex2/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/reduced_basis/reduced_basis_ex1/Makefile.in b/examples/reduced_basis/reduced_basis_ex1/Makefile.in index 6db1cdf53f..08bb048a3e 100644 --- a/examples/reduced_basis/reduced_basis_ex1/Makefile.in +++ b/examples/reduced_basis/reduced_basis_ex1/Makefile.in @@ -481,6 +481,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/reduced_basis/reduced_basis_ex2/Makefile.in b/examples/reduced_basis/reduced_basis_ex2/Makefile.in index c10dbe572b..1531d8bac4 100644 --- a/examples/reduced_basis/reduced_basis_ex2/Makefile.in +++ b/examples/reduced_basis/reduced_basis_ex2/Makefile.in @@ -481,6 +481,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/reduced_basis/reduced_basis_ex3/Makefile.in b/examples/reduced_basis/reduced_basis_ex3/Makefile.in index bb97754114..2e68fbdb00 100644 --- a/examples/reduced_basis/reduced_basis_ex3/Makefile.in +++ b/examples/reduced_basis/reduced_basis_ex3/Makefile.in @@ -481,6 +481,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/reduced_basis/reduced_basis_ex4/Makefile.in b/examples/reduced_basis/reduced_basis_ex4/Makefile.in index c5d7fa4481..952a02a977 100644 --- a/examples/reduced_basis/reduced_basis_ex4/Makefile.in +++ b/examples/reduced_basis/reduced_basis_ex4/Makefile.in @@ -486,6 +486,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/reduced_basis/reduced_basis_ex5/Makefile.in b/examples/reduced_basis/reduced_basis_ex5/Makefile.in index dae06b5119..aa1ac82e45 100644 --- a/examples/reduced_basis/reduced_basis_ex5/Makefile.in +++ b/examples/reduced_basis/reduced_basis_ex5/Makefile.in @@ -496,6 +496,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/reduced_basis/reduced_basis_ex6/Makefile.in b/examples/reduced_basis/reduced_basis_ex6/Makefile.in index dbad779ec6..711ce2cd7c 100644 --- a/examples/reduced_basis/reduced_basis_ex6/Makefile.in +++ b/examples/reduced_basis/reduced_basis_ex6/Makefile.in @@ -486,6 +486,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/reduced_basis/reduced_basis_ex7/Makefile.in b/examples/reduced_basis/reduced_basis_ex7/Makefile.in index 9aabc2bcac..a8c5b8e8f8 100644 --- a/examples/reduced_basis/reduced_basis_ex7/Makefile.in +++ b/examples/reduced_basis/reduced_basis_ex7/Makefile.in @@ -481,6 +481,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/solution_transfer/solution_transfer_ex1/Makefile.in b/examples/solution_transfer/solution_transfer_ex1/Makefile.in index aea51a825f..eb5413afa1 100644 --- a/examples/solution_transfer/solution_transfer_ex1/Makefile.in +++ b/examples/solution_transfer/solution_transfer_ex1/Makefile.in @@ -457,6 +457,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/subdomains/subdomains_ex1/Makefile.in b/examples/subdomains/subdomains_ex1/Makefile.in index 74e7ca8b2b..4c70439209 100644 --- a/examples/subdomains/subdomains_ex1/Makefile.in +++ b/examples/subdomains/subdomains_ex1/Makefile.in @@ -472,6 +472,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/subdomains/subdomains_ex2/Makefile.in b/examples/subdomains/subdomains_ex2/Makefile.in index ef44a8de4d..d012fcf105 100644 --- a/examples/subdomains/subdomains_ex2/Makefile.in +++ b/examples/subdomains/subdomains_ex2/Makefile.in @@ -472,6 +472,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/subdomains/subdomains_ex3/Makefile.in b/examples/subdomains/subdomains_ex3/Makefile.in index c18f3bc996..1c72950400 100644 --- a/examples/subdomains/subdomains_ex3/Makefile.in +++ b/examples/subdomains/subdomains_ex3/Makefile.in @@ -466,6 +466,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex1/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex1/Makefile.in index 87c31ab769..0dfd5f7537 100644 --- a/examples/systems_of_equations/systems_of_equations_ex1/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex1/Makefile.in @@ -458,6 +458,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex2/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex2/Makefile.in index 3bcd01f5e1..3bb1c7b702 100644 --- a/examples/systems_of_equations/systems_of_equations_ex2/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex2/Makefile.in @@ -463,6 +463,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex3/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex3/Makefile.in index d39370e277..3114286e30 100644 --- a/examples/systems_of_equations/systems_of_equations_ex3/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex3/Makefile.in @@ -458,6 +458,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex4/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex4/Makefile.in index 5d8566db49..6ef5964ca9 100644 --- a/examples/systems_of_equations/systems_of_equations_ex4/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex4/Makefile.in @@ -458,6 +458,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex5/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex5/Makefile.in index be7e1e080d..c978098441 100644 --- a/examples/systems_of_equations/systems_of_equations_ex5/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex5/Makefile.in @@ -458,6 +458,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex6/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex6/Makefile.in index 41be711257..c1f20ab875 100644 --- a/examples/systems_of_equations/systems_of_equations_ex6/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex6/Makefile.in @@ -458,6 +458,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex7/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex7/Makefile.in index db61114c05..cf7937f0de 100644 --- a/examples/systems_of_equations/systems_of_equations_ex7/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex7/Makefile.in @@ -464,6 +464,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex8/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex8/Makefile.in index 4b42ee36eb..ab74e5377b 100644 --- a/examples/systems_of_equations/systems_of_equations_ex8/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex8/Makefile.in @@ -502,6 +502,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/systems_of_equations/systems_of_equations_ex9/Makefile.in b/examples/systems_of_equations/systems_of_equations_ex9/Makefile.in index 93f3709c94..e75743a551 100644 --- a/examples/systems_of_equations/systems_of_equations_ex9/Makefile.in +++ b/examples/systems_of_equations/systems_of_equations_ex9/Makefile.in @@ -464,6 +464,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/transient/transient_ex1/Makefile.in b/examples/transient/transient_ex1/Makefile.in index 0bf1806bc9..1795ff08d5 100644 --- a/examples/transient/transient_ex1/Makefile.in +++ b/examples/transient/transient_ex1/Makefile.in @@ -472,6 +472,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/transient/transient_ex2/Makefile.in b/examples/transient/transient_ex2/Makefile.in index 6958f4fdaa..a82bc8ea97 100644 --- a/examples/transient/transient_ex2/Makefile.in +++ b/examples/transient/transient_ex2/Makefile.in @@ -458,6 +458,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/transient/transient_ex3/Makefile.in b/examples/transient/transient_ex3/Makefile.in index 63fca6c2bd..dde8778886 100644 --- a/examples/transient/transient_ex3/Makefile.in +++ b/examples/transient/transient_ex3/Makefile.in @@ -506,6 +506,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex1/Makefile.in b/examples/vector_fe/vector_fe_ex1/Makefile.in index b685131f37..cc3f3813dd 100644 --- a/examples/vector_fe/vector_fe_ex1/Makefile.in +++ b/examples/vector_fe/vector_fe_ex1/Makefile.in @@ -470,6 +470,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex10/Makefile.in b/examples/vector_fe/vector_fe_ex10/Makefile.in index 40a494c957..c13261ac5b 100644 --- a/examples/vector_fe/vector_fe_ex10/Makefile.in +++ b/examples/vector_fe/vector_fe_ex10/Makefile.in @@ -481,6 +481,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex2/Makefile.in b/examples/vector_fe/vector_fe_ex2/Makefile.in index 7430dcf804..f2c9a2bd6d 100644 --- a/examples/vector_fe/vector_fe_ex2/Makefile.in +++ b/examples/vector_fe/vector_fe_ex2/Makefile.in @@ -496,6 +496,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex3/Makefile.in b/examples/vector_fe/vector_fe_ex3/Makefile.in index 8d3aaf7e50..2f5f9d0a6e 100644 --- a/examples/vector_fe/vector_fe_ex3/Makefile.in +++ b/examples/vector_fe/vector_fe_ex3/Makefile.in @@ -496,6 +496,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex4/Makefile.in b/examples/vector_fe/vector_fe_ex4/Makefile.in index fae862b1b9..c659f7d197 100644 --- a/examples/vector_fe/vector_fe_ex4/Makefile.in +++ b/examples/vector_fe/vector_fe_ex4/Makefile.in @@ -496,6 +496,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex5/Makefile.in b/examples/vector_fe/vector_fe_ex5/Makefile.in index af1e1efad8..be5abe6828 100644 --- a/examples/vector_fe/vector_fe_ex5/Makefile.in +++ b/examples/vector_fe/vector_fe_ex5/Makefile.in @@ -483,6 +483,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex6/Makefile.in b/examples/vector_fe/vector_fe_ex6/Makefile.in index 19a679b616..f6c2ee175a 100644 --- a/examples/vector_fe/vector_fe_ex6/Makefile.in +++ b/examples/vector_fe/vector_fe_ex6/Makefile.in @@ -481,6 +481,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex7/Makefile.in b/examples/vector_fe/vector_fe_ex7/Makefile.in index 9ec4b44ee1..63d977adc8 100644 --- a/examples/vector_fe/vector_fe_ex7/Makefile.in +++ b/examples/vector_fe/vector_fe_ex7/Makefile.in @@ -481,6 +481,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex8/Makefile.in b/examples/vector_fe/vector_fe_ex8/Makefile.in index b004afe831..5ec03f065b 100644 --- a/examples/vector_fe/vector_fe_ex8/Makefile.in +++ b/examples/vector_fe/vector_fe_ex8/Makefile.in @@ -481,6 +481,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/examples/vector_fe/vector_fe_ex9/Makefile.in b/examples/vector_fe/vector_fe_ex9/Makefile.in index a83c38da3f..2901d49ec7 100644 --- a/examples/vector_fe/vector_fe_ex9/Makefile.in +++ b/examples/vector_fe/vector_fe_ex9/Makefile.in @@ -491,6 +491,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/include/Makefile.in b/include/Makefile.in index 32275438aa..9150cbc85d 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -372,6 +372,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/include/libmesh/Makefile.in b/include/libmesh/Makefile.in index 318a50a93b..1531496c94 100644 --- a/include/libmesh/Makefile.in +++ b/include/libmesh/Makefile.in @@ -301,6 +301,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@ diff --git a/include/libmesh_config.h.in b/include/libmesh_config.h.in index 9adaa9efe0..a8318aa5e6 100644 --- a/include/libmesh_config.h.in +++ b/include/libmesh_config.h.in @@ -343,6 +343,12 @@ /* Flag indicating whether compiler supports std::*::merge */ #undef HAVE_CXX17_SPLICING +/* define if the compiler supports basic C++20 syntax */ +#undef HAVE_CXX20 + +/* define if the compiler supports basic C++23 syntax */ +#undef HAVE_CXX23 + /* Define to 1 if you have the declaration of 'sigaction', and to 0 if you don't. */ #undef HAVE_DECL_SIGACTION diff --git a/tests/Makefile.in b/tests/Makefile.in index 43b4e077a9..679d9c5524 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -2071,6 +2071,8 @@ GZSTREAM_LIB = @GZSTREAM_LIB@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_CXX14 = @HAVE_CXX14@ HAVE_CXX17 = @HAVE_CXX17@ +HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ HAVE_DOT = @HAVE_DOT@ HAVE_GCOV_TOOLS = @HAVE_GCOV_TOOLS@ HDF5_CFLAGS = @HDF5_CFLAGS@