From 1cca915415087b0c2528c147aa241762050b85e6 Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Wed, 15 Apr 2026 17:23:18 +0800 Subject: [PATCH] [chore] Adopt C++23 as the default standard Switch the project default to C++23 and remove redundant per-target C++20 settings. This prepares the codebase for future coroutine adoption, enables more modern language features, and positions us to benefit from ongoing standard library improvements and performance optimizations. --- CMakeLists.txt | 2 +- bolt/common/memory/tests/CMakeLists.txt | 2 -- bolt/common/token/CMakeLists.txt | 1 - bolt/exec/CMakeLists.txt | 2 -- bolt/exec/tests/CMakeLists.txt | 2 -- bolt/functions/prestosql/json/CMakeLists.txt | 1 - bolt/functions/prestosql/types/CMakeLists.txt | 3 --- bolt/jit/tests/CMakeLists.txt | 1 - 8 files changed, 1 insertion(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c72259f3..464b5c851 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -438,7 +438,7 @@ endif() # Required so bolt code can be used in a dynamic library set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED True) # execute_process( COMMAND bash -c "( source diff --git a/bolt/common/memory/tests/CMakeLists.txt b/bolt/common/memory/tests/CMakeLists.txt index c36170315..56943898e 100644 --- a/bolt/common/memory/tests/CMakeLists.txt +++ b/bolt/common/memory/tests/CMakeLists.txt @@ -48,8 +48,6 @@ add_executable( StreamArenaTest.cpp ) -target_compile_features(bolt_memory_test PRIVATE cxx_std_20) - if(NOT APPLE) find_package(jemalloc CONFIG REQUIRED) endif() diff --git a/bolt/common/token/CMakeLists.txt b/bolt/common/token/CMakeLists.txt index 0dcaf2fa5..33c590038 100644 --- a/bolt/common/token/CMakeLists.txt +++ b/bolt/common/token/CMakeLists.txt @@ -14,6 +14,5 @@ # limitations under the License. bolt_add_library(bolt_token_extractor ITokenExtractor.cpp) -target_compile_features(bolt_token_extractor PRIVATE cxx_std_20) target_link_libraries(bolt_token_extractor xxHash::xxhash Folly::folly) diff --git a/bolt/exec/CMakeLists.txt b/bolt/exec/CMakeLists.txt index 7f1a6421d..3cd5360b2 100644 --- a/bolt/exec/CMakeLists.txt +++ b/bolt/exec/CMakeLists.txt @@ -122,8 +122,6 @@ bolt_add_library( WindowPartition.cpp ) -target_compile_features(bolt_exec PRIVATE cxx_std_20) - set_target_properties(bolt_exec PROPERTIES ENABLE_EXPORTS ON) if(${ENABLE_BOLT_JIT}) diff --git a/bolt/exec/tests/CMakeLists.txt b/bolt/exec/tests/CMakeLists.txt index d9a578ee3..ff67f524d 100644 --- a/bolt/exec/tests/CMakeLists.txt +++ b/bolt/exec/tests/CMakeLists.txt @@ -125,8 +125,6 @@ add_executable(bolt_exec_unested_test Main.cpp UnnestTest.cpp) add_executable(bolt_exec_table_writer_test Main.cpp TableWriteTest.cpp) -target_compile_features(bolt_exec_test PRIVATE cxx_std_20) - add_executable( bolt_exec_infra_test AssertQueryBuilderTest.cpp diff --git a/bolt/functions/prestosql/json/CMakeLists.txt b/bolt/functions/prestosql/json/CMakeLists.txt index 84f7c61dc..1eaadf1d3 100644 --- a/bolt/functions/prestosql/json/CMakeLists.txt +++ b/bolt/functions/prestosql/json/CMakeLists.txt @@ -44,7 +44,6 @@ target_link_libraries( sonic-cpp::sonic-cpp Folly::folly ) -target_compile_features(bolt_functions_json PRIVATE cxx_std_20) if(${BOLT_BUILD_TESTING}) add_subdirectory(tests) diff --git a/bolt/functions/prestosql/types/CMakeLists.txt b/bolt/functions/prestosql/types/CMakeLists.txt index 046e82bb6..eb25943c1 100644 --- a/bolt/functions/prestosql/types/CMakeLists.txt +++ b/bolt/functions/prestosql/types/CMakeLists.txt @@ -27,9 +27,6 @@ bolt_add_library(bolt_presto_types HyperLogLogType.cpp JsonType.cpp TimestampWithTimeZoneType.cpp) -# JsonType.cpp needs to rely on the concept attribute in C++20 -target_compile_features(bolt_presto_types PRIVATE cxx_std_20) - find_package(ryu CONFIG REQUIRED) target_link_libraries( diff --git a/bolt/jit/tests/CMakeLists.txt b/bolt/jit/tests/CMakeLists.txt index 1e2ed11bf..7e9878bb8 100644 --- a/bolt/jit/tests/CMakeLists.txt +++ b/bolt/jit/tests/CMakeLists.txt @@ -19,7 +19,6 @@ if(${ENABLE_BOLT_JIT}) RowContainerIRTest.cpp ThrustJITv2Test.cpp ) - target_compile_features(bolt_thrustjit_test PUBLIC cxx_std_20) target_link_libraries( bolt_thrustjit_test PRIVATE bolt_testutils