diff --git a/CMakeLists.txt b/CMakeLists.txt index b6cc41e68..b31883f96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,12 +24,12 @@ set (CMAKE_POSITION_INDEPENDENT_CODE ON) enable_language (CXX) if (MSVC) - set (CMAKE_CXX_STANDARD 20) + set (CMAKE_CXX_STANDARD 23) if (CMAKE_VS_PLATFORM_NAME MATCHES "ARM") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") endif () else () - set (CMAKE_CXX_STANDARD 20) + set (CMAKE_CXX_STANDARD 23) endif () set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_EXTENSIONS ON) diff --git a/Makefile.in b/Makefile.in index 3f6e59860..7de3d5c56 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1086,7 +1086,7 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ -HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/configure b/configure index 6ff04d765..64d5ef715 100755 --- a/configure +++ b/configure @@ -724,7 +724,7 @@ USE_LOG4CPLUS_EXPORT_SYMBOLS_REGEX_TRUE LOG4CPLUS_AIX_XLC_LDFLAGS GREP SED -HAVE_CXX20 +HAVE_CXX23 CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE @@ -6684,7 +6684,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ax_cxx_compile_alternatives="20" ax_cxx_compile_cxx20_required=true + ax_cxx_compile_alternatives="23 2b" ax_cxx_compile_cxx23_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6692,9 +6692,9 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no - { 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} + { 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 #( @@ -7516,29 +7516,55 @@ namespace cxx20 + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202302L && !defined _MSC_VER + +#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 // __cplusplus < 202302L && !defined _MSC_VER + + + _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : - ax_cv_cxx_compile_cxx20=yes + ax_cv_cxx_compile_cxx23=yes else case e in #( - e) ax_cv_cxx_compile_cxx20=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 -{ 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 +{ 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 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_cxx20_$switch" | sed "$as_sed_sh"` - { 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; } + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx23_$switch" | sed "$as_sed_sh"` + { 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 @@ -8363,6 +8389,32 @@ namespace cxx20 + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202302L && !defined _MSC_VER + +#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 // __cplusplus < 202302L && !defined _MSC_VER + + + _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : @@ -8392,9 +8444,9 @@ printf "%s\n" "$ac_res" >&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}"; do - cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx20_$switch" | sed "$as_sed_sh"` - { 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; } + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx23_$switch" | sed "$as_sed_sh"` + { 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 @@ -9219,6 +9271,32 @@ namespace cxx20 + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202302L && !defined _MSC_VER + +#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 // __cplusplus < 202302L && !defined _MSC_VER + + + _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : @@ -9254,19 +9332,19 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test x$ax_cxx_compile_cxx20_required = xtrue; then + 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++20 language features is required." "$LINENO" 5 + 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_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;} + 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_CXX20=1 + HAVE_CXX23=1 -printf "%s\n" "#define HAVE_CXX20 1" >>confdefs.h +printf "%s\n" "#define HAVE_CXX23 1" >>confdefs.h fi diff --git a/configure.ac b/configure.ac index 22e29c82c..6f7b9c9d9 100644 --- a/configure.ac +++ b/configure.ac @@ -179,7 +179,7 @@ AC_PROG_CXX AC_PROG_CXXCPP AC_LANG([C++]) -AX_CXX_COMPILE_STDCXX([20],[],[mandatory]) +AX_CXX_COMPILE_STDCXX([23],[],[mandatory]) AS_VAR_APPEND([CPPFLAGS], [" -D_GNU_SOURCE=1"]) diff --git a/include/Makefile.in b/include/Makefile.in index 9a7d2fd4c..eff74c6be 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -229,7 +229,7 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ -HAVE_CXX20 = @HAVE_CXX20@ +HAVE_CXX23 = @HAVE_CXX23@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 index a3d964c69..6140a01d6 100644 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ b/m4/ax_cxx_compile_stdcxx.m4 @@ -52,7 +52,8 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], [$1], [14], [ax_cxx_compile_alternatives="14 1y"], [$1], [17], [ax_cxx_compile_alternatives="17 1z"], - [$1], [20], [ax_cxx_compile_alternatives="20"], + [$1], [20], [ax_cxx_compile_alternatives="20 2a"], + [$1], [23], [ax_cxx_compile_alternatives="23 2b"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], @@ -177,6 +178,16 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 ) +dnl Test body for checking C++23 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_23], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_23 +) + dnl Tests for new features in C++11 @@ -1007,3 +1018,33 @@ namespace cxx20 #endif // __cplusplus < 202002L && !defined _MSC_VER ]]) + + +dnl Tests for new features in C++23 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_23], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202302L && !defined _MSC_VER + +#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 // __cplusplus < 202302L && !defined _MSC_VER + +]])