From 2cfc4d2c59af00ebf63b1edd5f9e0c68d730671b Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Thu, 16 Apr 2026 12:09:30 -0700 Subject: [PATCH 1/4] Add -Wno-c2y-extensions to test/CMakeLists.txt As of some recent commit, building the tests with Clang 22.1 fails with errors like this: ``` git/stdexec/test/stdexec/cpos/test_cpo_start.cpp:70:3: error: '__COUNTER__' is a C2y extension [-Werror,-Wc2y-extensions] 70 | TEST_CASE("can call start on an operation state", "[cpo][cpo_start]") | ^ ``` Adding `-Wno-c2y-extensions` (or variations, like `-Wno-pedantic`) to the `-DCMAKE_CXX_FLAGS` config-time parameters doesn't seems to help; the flags added there end up *before* `-Wpedantic` in the compiler command line, and, possibly because of llvm/llvm-project#184250, Clang doesn't override `-Wpedantic` with an earlier-supplied suppression. This diff just adds the required warning in the required place in the hard-coded compiler warning flags to suppress the warning for everyone. (https://github.com/llvm/llvm-project/issues/184250) --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6256522ed..690cc83cd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,7 +16,7 @@ function(add_compile_diagnostics TARGET) if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU) - target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror) + target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror -Wno-c2y-extensions) endif() endfunction() From 7185e6449048dc748e899a6dae768e7873dbf182 Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Thu, 16 Apr 2026 13:14:03 -0700 Subject: [PATCH 2/4] Fix build Make the new warning suppression flag conditional on its availability and add Clang 22 to the CI matrix (debug builds only) to validate this change works in CI, too. --- .github/workflows/ci.cpu.yml | 2 ++ test/CMakeLists.txt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.cpu.yml b/.github/workflows/ci.cpu.yml index 24b3f9e9d..91231d7a1 100644 --- a/.github/workflows/ci.cpu.yml +++ b/.github/workflows/ci.cpu.yml @@ -24,6 +24,8 @@ jobs: - { name: "CPU (clang 16, Debug, TSAN)", build: "Debug", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=thread" } - { name: "CPU (clang 16, Release)", build: "Release", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++" } - { name: "CPU (clang 16, Release, ASAN)", build: "Release", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++ -fsanitize=address -fsanitize-ignorelist=/home/coder/stdexec/sanitizer-ignorelist.txt" } + - { name: "CPU (clang 22, Debug)", build: "Debug", tag: llvm22-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++" } + - { name: "CPU (clang 22, Debug, c++23)", build: "Debug", tag: llvm22-cuda12.9, cxxstd: "23", cxxflags: "-stdlib=libc++" } - { name: "CPU (gcc 12, Debug)", build: "Debug", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "", } - { name: "CPU (gcc 12, Release)", build: "Release", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "", } # With the following config, 2 tests mysteriously time out, but only in CI and not locally. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 690cc83cd..aea650259 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,10 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= +include(CheckCompilerFlag) +check_compiler_flag(CXX -Wno-c2y-extensions HAVE_C2Y_EXTENSIONS_WARNING) function(add_compile_diagnostics TARGET) if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU) - target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror -Wno-c2y-extensions) + target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror $<$:-Wno-c2y-extensions>) endif() endfunction() From 64999edf61ab885a2e88a6b1c14f4b8b7e4937ac Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Thu, 16 Apr 2026 13:29:12 -0700 Subject: [PATCH 3/4] Apply suggestion from @ericniebler --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aea650259..e14a0469d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -18,7 +18,7 @@ check_compiler_flag(CXX -Wno-c2y-extensions HAVE_C2Y_EXTENSIONS_WARNING) function(add_compile_diagnostics TARGET) if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU) - target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror $<$:-Wno-c2y-extensions>) + target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror $<$:-Wno-c2y-extensions>) endif() endfunction() From c7199d7c8d9e120ea01fd00b63ef22e64f800a5d Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Thu, 16 Apr 2026 13:50:09 -0700 Subject: [PATCH 4/4] Undo addition to CI matrix My attempt to add Clang 22 builds to the CI matrix needs fixing; let's do that in another PR. --- .github/workflows/ci.cpu.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.cpu.yml b/.github/workflows/ci.cpu.yml index 91231d7a1..24b3f9e9d 100644 --- a/.github/workflows/ci.cpu.yml +++ b/.github/workflows/ci.cpu.yml @@ -24,8 +24,6 @@ jobs: - { name: "CPU (clang 16, Debug, TSAN)", build: "Debug", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-fsanitize=thread" } - { name: "CPU (clang 16, Release)", build: "Release", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++" } - { name: "CPU (clang 16, Release, ASAN)", build: "Release", tag: llvm16-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++ -fsanitize=address -fsanitize-ignorelist=/home/coder/stdexec/sanitizer-ignorelist.txt" } - - { name: "CPU (clang 22, Debug)", build: "Debug", tag: llvm22-cuda12.9, cxxstd: "20", cxxflags: "-stdlib=libc++" } - - { name: "CPU (clang 22, Debug, c++23)", build: "Debug", tag: llvm22-cuda12.9, cxxstd: "23", cxxflags: "-stdlib=libc++" } - { name: "CPU (gcc 12, Debug)", build: "Debug", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "", } - { name: "CPU (gcc 12, Release)", build: "Release", tag: gcc12-cuda12.9, cxxstd: "20", cxxflags: "", } # With the following config, 2 tests mysteriously time out, but only in CI and not locally.