[libcxx-commits] [libcxx] [AIX] cxx_std_23 is currently not a known feature to ibm-clang (PR #66952)

Jake Egan via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 20 22:25:08 PDT 2023


https://github.com/jakeegan updated https://github.com/llvm/llvm-project/pull/66952

>From 89affb705abe7d33a0e299c2080d6bcb4d4de884 Mon Sep 17 00:00:00 2001
From: Jake Egan <5326451+jakeegan at users.noreply.github.com>
Date: Wed, 20 Sep 2023 16:26:10 -0400
Subject: [PATCH 1/3] [AIX] cxx_std_23 is currently not a known feature to
 ibm-clang

---
 libcxx/benchmarks/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libcxx/benchmarks/CMakeLists.txt b/libcxx/benchmarks/CMakeLists.txt
index ccc98df638ae397..05467dca23e50dc 100644
--- a/libcxx/benchmarks/CMakeLists.txt
+++ b/libcxx/benchmarks/CMakeLists.txt
@@ -81,7 +81,9 @@ add_library(               cxx-benchmarks-flags INTERFACE)
 # requesting `cxx_std_23` results in an error -- somehow CMake fails to
 # translate the `c++23` flag into `c++latest`, and the highest numbered C++
 # version that MSVC flags support is C++20.
-if (MSVC)
+# ibm-clang does not recognize the cxx_std_32 flag, so use this as a temporary
+# workaround on AIX as well.
+if (MSVC OR ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
   add_compile_options(/std:c++latest)
 else()
   target_compile_features( cxx-benchmarks-flags INTERFACE cxx_std_23)

>From 13aa35f294f1bed5760010df1cb6806983c9180a Mon Sep 17 00:00:00 2001
From: Jake Egan <5326451+jakeegan at users.noreply.github.com>
Date: Thu, 21 Sep 2023 01:23:15 -0400
Subject: [PATCH 2/3] use -std option

---
 libcxx/benchmarks/CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libcxx/benchmarks/CMakeLists.txt b/libcxx/benchmarks/CMakeLists.txt
index 05467dca23e50dc..18aaa97c28e9413 100644
--- a/libcxx/benchmarks/CMakeLists.txt
+++ b/libcxx/benchmarks/CMakeLists.txt
@@ -81,10 +81,12 @@ add_library(               cxx-benchmarks-flags INTERFACE)
 # requesting `cxx_std_23` results in an error -- somehow CMake fails to
 # translate the `c++23` flag into `c++latest`, and the highest numbered C++
 # version that MSVC flags support is C++20.
-# ibm-clang does not recognize the cxx_std_32 flag, so use this as a temporary
-# workaround on AIX as well.
 if (MSVC OR ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
   add_compile_options(/std:c++latest)
+# ibm-clang does not recognize the cxx_std_32 flag, so use this as a temporary
+# workaround on AIX as well.
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
+  add_compile_options(-std=c++23)
 else()
   target_compile_features( cxx-benchmarks-flags INTERFACE cxx_std_23)
 endif()

>From 1256414b751eb5351ca8bc20e466a7c7e8dd8886 Mon Sep 17 00:00:00 2001
From: Jake Egan <5326451+jakeegan at users.noreply.github.com>
Date: Thu, 21 Sep 2023 01:25:00 -0400
Subject: [PATCH 3/3] Remove first AIX check

---
 libcxx/benchmarks/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/benchmarks/CMakeLists.txt b/libcxx/benchmarks/CMakeLists.txt
index 18aaa97c28e9413..c7cb3309f71bde8 100644
--- a/libcxx/benchmarks/CMakeLists.txt
+++ b/libcxx/benchmarks/CMakeLists.txt
@@ -81,7 +81,7 @@ add_library(               cxx-benchmarks-flags INTERFACE)
 # requesting `cxx_std_23` results in an error -- somehow CMake fails to
 # translate the `c++23` flag into `c++latest`, and the highest numbered C++
 # version that MSVC flags support is C++20.
-if (MSVC OR ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
+if (MSVC)
   add_compile_options(/std:c++latest)
 # ibm-clang does not recognize the cxx_std_32 flag, so use this as a temporary
 # workaround on AIX as well.



More information about the libcxx-commits mailing list