From c3e45088a6d126fbec5d86e366810802d569a57c Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Mon, 9 Dec 2024 15:27:36 +0100 Subject: [PATCH 01/12] Fixes for apple-clang crashes and performance issues The source of the crash with the latest changes seemed to be from the `IsOfCharacter` concept. This concept was refactored to use some type traits and more simple concepts although with less strict requirements. A new macro, `MP_UNITS_APPLE_CLANG_HACKS` was added to mp-units/bits/hacks.h to enable work arounds for pre-Xcode 16.1 apple-clang. Some tests were not passing and were removed with the preprocessor macro for apple-clang hacks is defined. Adding `ComplexFunctionsAvailable` and `VectorFunctionsAvailable` fixed some test failures in concepts_test.cpp but not all. --- src/core/include/mp-units/bits/hacks.h | 4 +++ .../framework/representation_concepts.h | 35 +++++++++++++++++-- test/static/concepts_test.cpp | 3 ++ test/static/quantity_test.cpp | 6 +++- 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/core/include/mp-units/bits/hacks.h b/src/core/include/mp-units/bits/hacks.h index 3b8c9a89..f27c5438 100644 --- a/src/core/include/mp-units/bits/hacks.h +++ b/src/core/include/mp-units/bits/hacks.h @@ -150,5 +150,9 @@ MP_UNITS_DIAGNOSTIC_POP #define MP_UNITS_API_NO_CRTP 1 +#endif + +#if defined(__clang__) && defined(__apple_build_version__) && __apple_build_version__ < 16000026 +#define MP_UNITS_APPLE_CLANG_HACKS #endif // NOLINTEND(bugprone-reserved-identifier, cppcoreguidelines-macro-usage) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index ff99bd96..5ff83189 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -190,6 +190,7 @@ concept Complex = (!disable_complex) && requires(const T a, const T b, const requires std::constructible_from; } && WeaklyRegular; + namespace magnitude_impl { void magnitude() = delete; // poison pill @@ -309,15 +310,45 @@ concept VectorRepresentation = (!is_quantity) && Vector && requires(const MP_UNITS_EXPORT template concept Representation = detail::ScalarRepresentation || detail::ComplexRepresentation || - detail::VectorRepresentation; // || detail::TensorRepresentation; + detail::VectorRepresentation; // || detail::TensorRepresentation; */ namespace detail { +#ifdef MP_UNITS_APPLE_CLANG_HACKS +template +constexpr bool is_weakly_regular = std::copyable && std::equality_comparable; + +template +constexpr bool is_scalar = !disable_scalar && is_weakly_regular; + +template +constexpr bool is_complex = !disable_complex && is_weakly_regular && is_scalar> && + std::constructible_from, value_type_t>; + +template +concept ComplexFunctionsAvailable = requires(T a) { + ::mp_units::real(a); + ::mp_units::imag(a); + ::mp_units::modulus(a); +}; + +template +constexpr bool is_vector = !disable_vector && is_weakly_regular && is_scalar>; + +template +concept VectorFunctionsAvailable = requires(T a) { ::mp_units::magnitude(a); }; + + +template +concept IsOfCharacter = ((Ch == quantity_character::scalar && is_scalar) || + (Ch == quantity_character::complex && is_complex && ComplexFunctionsAvailable) || + (Ch == quantity_character::vector && is_vector && VectorFunctionsAvailable)); +#else template concept IsOfCharacter = (Ch == quantity_character::scalar && Scalar) || (Ch == quantity_character::complex && Complex) || (Ch == quantity_character::vector && Vector); // || (Ch == quantity_character::tensor && Tensor); - +#endif } MP_UNITS_EXPORT template diff --git a/test/static/concepts_test.cpp b/test/static/concepts_test.cpp index 0b1a7bab..2cf15448 100644 --- a/test/static/concepts_test.cpp +++ b/test/static/concepts_test.cpp @@ -20,6 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include #include #include #include @@ -308,7 +309,9 @@ static_assert(!RepresentationOf, quantity_character::scalar static_assert(!RepresentationOf, quantity_character::vector>); static_assert(!RepresentationOf, quantity_character::tensor>); static_assert(RepresentationOf, quantity_character::vector>); +#ifndef MP_UNITS_APPLE_CLANG_HACKS static_assert(!RepresentationOf, quantity_character::scalar>); +#endif static_assert(!RepresentationOf, quantity_character::complex>); static_assert(!RepresentationOf, quantity_character::tensor>); static_assert(!RepresentationOf); diff --git a/test/static/quantity_test.cpp b/test/static/quantity_test.cpp index 3b8d14d5..40948a2d 100644 --- a/test/static/quantity_test.cpp +++ b/test/static/quantity_test.cpp @@ -65,6 +65,8 @@ static_assert(sizeof(quantity) == sizeof(double)); static_assert(sizeof(quantity) == sizeof(short)); static_assert(sizeof(quantity) == sizeof(short)); +#ifndef MP_UNITS_APPLE_CLANG_HACKS + template typename Q> concept invalid_types = requires { requires !requires { typename Q; }; // dimension instead of reference @@ -77,13 +79,15 @@ concept invalid_types = requires { }; // vector representation expected requires !requires { typename Q>; - }; // scalar representation expected + }; // scalar representation expected requires !requires { typename Q>; }; // incompatible character requires !requires { typename Q; }; // incompatible character #endif }; static_assert(invalid_types); +#endif + static_assert(std::is_trivially_default_constructible_v>); static_assert(std::is_trivially_copy_constructible_v>); static_assert(std::is_trivially_move_constructible_v>); From d30f5a668c20dc3ac3d784601be2cde8f5c1201d Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Mon, 9 Dec 2024 17:53:13 +0100 Subject: [PATCH 02/12] clang-format fixes --- src/core/include/mp-units/framework/representation_concepts.h | 2 +- test/static/quantity_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index 5ff83189..0a6950d9 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -349,7 +349,7 @@ concept IsOfCharacter = (Ch == quantity_character::scalar && Scalar) || (Ch == quantity_character::complex && Complex) || (Ch == quantity_character::vector && Vector); // || (Ch == quantity_character::tensor && Tensor); #endif -} +} // namespace detail MP_UNITS_EXPORT template concept RepresentationOf = diff --git a/test/static/quantity_test.cpp b/test/static/quantity_test.cpp index 40948a2d..418c66a9 100644 --- a/test/static/quantity_test.cpp +++ b/test/static/quantity_test.cpp @@ -79,7 +79,7 @@ concept invalid_types = requires { }; // vector representation expected requires !requires { typename Q>; - }; // scalar representation expected + }; // scalar representation expected requires !requires { typename Q>; }; // incompatible character requires !requires { typename Q; }; // incompatible character #endif From ec3f0000507be608d4fa8b59180f2b49f280142a Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Mon, 9 Dec 2024 18:10:56 +0100 Subject: [PATCH 03/12] Update src/core/include/mp-units/framework/representation_concepts.h Co-authored-by: Mateusz Pusz --- src/core/include/mp-units/framework/representation_concepts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index 0a6950d9..82f403ab 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -310,7 +310,7 @@ concept VectorRepresentation = (!is_quantity) && Vector && requires(const MP_UNITS_EXPORT template concept Representation = detail::ScalarRepresentation || detail::ComplexRepresentation || - detail::VectorRepresentation; // || detail::TensorRepresentation; */ + detail::VectorRepresentation; // || detail::TensorRepresentation; namespace detail { From 0c3bb98c6dbb281e0b4b18f1dee1c5c973c63fbd Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Mon, 9 Dec 2024 18:11:03 +0100 Subject: [PATCH 04/12] Update src/core/include/mp-units/framework/representation_concepts.h Co-authored-by: Mateusz Pusz --- src/core/include/mp-units/framework/representation_concepts.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index 82f403ab..d556be51 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -190,7 +190,6 @@ concept Complex = (!disable_complex) && requires(const T a, const T b, const requires std::constructible_from; } && WeaklyRegular; - namespace magnitude_impl { void magnitude() = delete; // poison pill From ada508a683129d81ab977cf85802f860f1a683f4 Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Thu, 19 Dec 2024 10:40:15 -0500 Subject: [PATCH 05/12] Do not use WeaklyRegular with Xcode 15 for type detection Removing the `WeaklyRegular` requirement from the `Scalar`, `Complex`, and `Vector` concepts seems to address compiler crashes or long compilation times with apple-clang included in Xcode 15. I thought I had previously tried removing the `WeaklyRegular` requirement and it had not solved the problem but either I made a mistake with this test or some other changes after rebasing this work changed the situation. --- src/core/include/mp-units/bits/hacks.h | 2 +- .../framework/representation_concepts.h | 96 ++++++++----------- test/static/concepts_test.cpp | 3 - test/static/quantity_test.cpp | 4 - 4 files changed, 39 insertions(+), 66 deletions(-) diff --git a/src/core/include/mp-units/bits/hacks.h b/src/core/include/mp-units/bits/hacks.h index f27c5438..f9e98f24 100644 --- a/src/core/include/mp-units/bits/hacks.h +++ b/src/core/include/mp-units/bits/hacks.h @@ -153,6 +153,6 @@ MP_UNITS_DIAGNOSTIC_POP #endif #if defined(__clang__) && defined(__apple_build_version__) && __apple_build_version__ < 16000026 -#define MP_UNITS_APPLE_CLANG_HACKS +#define MP_UNITS_XCODE15_HACKS #endif // NOLINTEND(bugprone-reserved-identifier, cppcoreguidelines-macro-usage) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index d556be51..37e5354a 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -88,7 +88,7 @@ concept Scalar = (!disable_scalar) && { a + b } -> std::common_with; { a - b } -> std::common_with; } && ScalableWith -#if MP_UNITS_COMP_GCC != 12 +#if MP_UNITS_COMP_GCC != 12 && !defined(MP_UNITS_XCODE15_HACKS) && WeaklyRegular #endif ; @@ -177,18 +177,23 @@ constexpr bool disable_complex = false; namespace detail { template -concept Complex = (!disable_complex) && requires(const T a, const T b, const T& c) { - { -a } -> std::common_with; - { a + b } -> std::common_with; - { a - b } -> std::common_with; - { a* b } -> std::common_with; - { a / b } -> std::common_with; - ::mp_units::real(a); - ::mp_units::imag(a); - ::mp_units::modulus(a); - requires ScalableWith; - requires std::constructible_from; -} && WeaklyRegular; +concept Complex = (!disable_complex) && + requires(const T a, const T b, const T& c) { + { -a } -> std::common_with; + { a + b } -> std::common_with; + { a - b } -> std::common_with; + { a* b } -> std::common_with; + { a / b } -> std::common_with; + ::mp_units::real(a); + ::mp_units::imag(a); + ::mp_units::modulus(a); + requires ScalableWith; + requires std::constructible_from; + } +#ifndef MP_UNITS_XCODE15_HACKS + && WeaklyRegular +#endif + ; namespace magnitude_impl { @@ -238,19 +243,24 @@ constexpr bool disable_vector = false; namespace detail { template -concept Vector = (!disable_vector) && requires(const T a, const T b) { - { -a } -> std::common_with; - { a + b } -> std::common_with; - { a - b } -> std::common_with; - ::mp_units::magnitude(a); - requires ScalableWith; - // TODO should we also check for the below (e.g., when `size() > 1` or `2`) - // ::mp_units::zero_vector(); - // ::mp_units::unit_vector(a); - // ::mp_units::scalar_product(a, b); - // ::mp_units::vector_product(a, b); - // ::mp_units::tensor_product(a, b); -} && WeaklyRegular; +concept Vector = (!disable_vector) && + requires(const T a, const T b) { + { -a } -> std::common_with; + { a + b } -> std::common_with; + { a - b } -> std::common_with; + ::mp_units::magnitude(a); + requires ScalableWith; + // TODO should we also check for the below (e.g., when `size() > 1` or `2`) + // ::mp_units::zero_vector(); + // ::mp_units::unit_vector(a); + // ::mp_units::scalar_product(a, b); + // ::mp_units::vector_product(a, b); + // ::mp_units::tensor_product(a, b); + } +#ifndef MP_UNITS_XCODE15_HACKS + && WeaklyRegular +#endif + ; } // namespace detail @@ -313,42 +323,12 @@ concept Representation = detail::ScalarRepresentation || detail::ComplexRepre namespace detail { -#ifdef MP_UNITS_APPLE_CLANG_HACKS -template -constexpr bool is_weakly_regular = std::copyable && std::equality_comparable; - -template -constexpr bool is_scalar = !disable_scalar && is_weakly_regular; - -template -constexpr bool is_complex = !disable_complex && is_weakly_regular && is_scalar> && - std::constructible_from, value_type_t>; - -template -concept ComplexFunctionsAvailable = requires(T a) { - ::mp_units::real(a); - ::mp_units::imag(a); - ::mp_units::modulus(a); -}; - -template -constexpr bool is_vector = !disable_vector && is_weakly_regular && is_scalar>; - -template -concept VectorFunctionsAvailable = requires(T a) { ::mp_units::magnitude(a); }; - - -template -concept IsOfCharacter = ((Ch == quantity_character::scalar && is_scalar) || - (Ch == quantity_character::complex && is_complex && ComplexFunctionsAvailable) || - (Ch == quantity_character::vector && is_vector && VectorFunctionsAvailable)); -#else template concept IsOfCharacter = (Ch == quantity_character::scalar && Scalar) || (Ch == quantity_character::complex && Complex) || (Ch == quantity_character::vector && Vector); // || (Ch == quantity_character::tensor && Tensor); -#endif -} // namespace detail + +} MP_UNITS_EXPORT template concept RepresentationOf = diff --git a/test/static/concepts_test.cpp b/test/static/concepts_test.cpp index 2cf15448..0b1a7bab 100644 --- a/test/static/concepts_test.cpp +++ b/test/static/concepts_test.cpp @@ -20,7 +20,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#include #include #include #include @@ -309,9 +308,7 @@ static_assert(!RepresentationOf, quantity_character::scalar static_assert(!RepresentationOf, quantity_character::vector>); static_assert(!RepresentationOf, quantity_character::tensor>); static_assert(RepresentationOf, quantity_character::vector>); -#ifndef MP_UNITS_APPLE_CLANG_HACKS static_assert(!RepresentationOf, quantity_character::scalar>); -#endif static_assert(!RepresentationOf, quantity_character::complex>); static_assert(!RepresentationOf, quantity_character::tensor>); static_assert(!RepresentationOf); diff --git a/test/static/quantity_test.cpp b/test/static/quantity_test.cpp index 418c66a9..3b8d14d5 100644 --- a/test/static/quantity_test.cpp +++ b/test/static/quantity_test.cpp @@ -65,8 +65,6 @@ static_assert(sizeof(quantity) == sizeof(double)); static_assert(sizeof(quantity) == sizeof(short)); static_assert(sizeof(quantity) == sizeof(short)); -#ifndef MP_UNITS_APPLE_CLANG_HACKS - template typename Q> concept invalid_types = requires { requires !requires { typename Q; }; // dimension instead of reference @@ -86,8 +84,6 @@ concept invalid_types = requires { }; static_assert(invalid_types); -#endif - static_assert(std::is_trivially_default_constructible_v>); static_assert(std::is_trivially_copy_constructible_v>); static_assert(std::is_trivially_move_constructible_v>); From 90aa52a6ccd14dc8b30acdd82ec6285b123ae278 Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Thu, 19 Dec 2024 11:21:17 -0500 Subject: [PATCH 06/12] Update src/core/include/mp-units/framework/representation_concepts.h Co-authored-by: Mateusz Pusz --- src/core/include/mp-units/framework/representation_concepts.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/include/mp-units/framework/representation_concepts.h b/src/core/include/mp-units/framework/representation_concepts.h index 37e5354a..58b806eb 100644 --- a/src/core/include/mp-units/framework/representation_concepts.h +++ b/src/core/include/mp-units/framework/representation_concepts.h @@ -194,7 +194,6 @@ concept Complex = (!disable_complex) && && WeaklyRegular #endif ; - namespace magnitude_impl { void magnitude() = delete; // poison pill From bf8dc4ac81691a945b025f53efd1e0653bd12cd9 Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Thu, 28 Nov 2024 16:36:33 +0100 Subject: [PATCH 07/12] Update Xcode versions for apple-clang builds Since mp-units requires at least Xcode 15 we should have coverage on the latest compilers for operating system versions for macOS 13 (Ventura) and macOS 14 (Sequoia) as those are the operating systems with necessary compilers that our users would be using. Now build with Xcode 15.2 instead of 15.0.1 which last version supported on macOS 13. Add a build for Xcode 15.4 and Xcode 16.1 for testing macOS 14 builds. Since Xcode 16.1 is new most of our clients using macOS 14 would might more likely be using Xcode 15.4. There might not be much C++ changes between Xcode 15.2 and Xcode 15.4 so perhaps we should drop 15.4 if adding three apple-clang builds is not worth the resources. --- .github/generate-job-matrix.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/generate-job-matrix.py b/.github/generate-job-matrix.py index bd14ee00..8c03b9e6 100644 --- a/.github/generate-job-matrix.py +++ b/.github/generate-job-matrix.py @@ -53,13 +53,13 @@ def make_clang_config( return Configuration(**vars(ret)) -def make_apple_clang_config(version: int) -> Configuration: +def make_apple_clang_config(os: str, version: str) -> Configuration: ret = Configuration( name=f"Apple Clang {version}", - os="macos-13", + os=os, compiler=Compiler( type="APPLE_CLANG", - version=f"{version}.0", + version=version, cc="clang", cxx="clang++", ), @@ -95,7 +95,8 @@ configs = { # arm64 runners are expensive; only consider one version if ver == 18 or platform != "arm64" ] - + [make_apple_clang_config(ver) for ver in [15]] + + [make_apple_clang_config("macos-13", ver) for ver in ["15.2"]] + + [make_apple_clang_config("macos-14", ver) for ver in ["15.4", "16.1"]] + [make_msvc_config(release="14.4", version=194)] } From b70ded5b8253c4d3535fdc244ab833ccb30d751f Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Thu, 19 Dec 2024 12:17:55 -0500 Subject: [PATCH 08/12] Drop 15.4 support from PR discussion --- .github/generate-job-matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/generate-job-matrix.py b/.github/generate-job-matrix.py index 8c03b9e6..a8ff414f 100644 --- a/.github/generate-job-matrix.py +++ b/.github/generate-job-matrix.py @@ -96,7 +96,7 @@ configs = { if ver == 18 or platform != "arm64" ] + [make_apple_clang_config("macos-13", ver) for ver in ["15.2"]] - + [make_apple_clang_config("macos-14", ver) for ver in ["15.4", "16.1"]] + + [make_apple_clang_config("macos-14", ver) for ver in ["16.1"]] + [make_msvc_config(release="14.4", version=194)] } From 43729c6190cb8157913b454a3c490f101bf9d82c Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Thu, 19 Dec 2024 11:47:00 -0500 Subject: [PATCH 09/12] Enable use of std::format for AppleClang / Xcode 16 Specified the minimum apple-clang version to support `std::format` to 16 for _connanfile.py_. Xcode 16 does include the `` header but does not seem to have the __cpp_lib_format compatibility macro defined so a similar override was needed as we had for Clang 17. To be able to use `std::format` with Xcode 16 I had to pass `-DMP_UNITS_API_STD_FORMAT=AUTO` when calling `cmake`. Is this expected or is this a sign I missed something in my changes to _CMakeLists.txt_? --- conanfile.py | 2 +- src/CMakeLists.txt | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/conanfile.py b/conanfile.py index 8026ddf6..696a9447 100644 --- a/conanfile.py +++ b/conanfile.py @@ -99,7 +99,7 @@ class MPUnitsConan(ConanFile): "compiler": { "gcc": "13", "clang": "17", - "apple-clang": "", + "apple-clang": "16", "msvc": "194", }, }, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0c7cfb7d..8bb70e4d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,13 +53,15 @@ check_cxx_feature_supported(__cpp_explicit_this_parameter ${projectPrefix}EXPLIC # libc++ has a basic supports for std::format but does not set __cpp_lib_format # https://github.com/llvm/llvm-project/issues/77773 -if(NOT ${projectPrefix}LIB_FORMAT_SUPPORTED - AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" - AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "17" - AND ${projectPrefix}LIBCXX -) - message(STATUS "Clang 17+ with libc++ detected, overriding `std::format` support") - set(${projectPrefix}LIB_FORMAT_SUPPORTED ON) +if(NOT ${projectPrefix}LIB_FORMAT_SUPPORTED AND ${projectPrefix}LIBCXX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "17") + message(STATUS "Clang 17+ with libc++ detected, overriding `std::format` support") + set(${projectPrefix}LIB_FORMAT_SUPPORTED ON) + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16") + message(STATUS "AppleClang 16+ with libc++ detected, overriding `std::format` support") + set(${projectPrefix}LIB_FORMAT_SUPPORTED ON) + endif() endif() # clang++-18 supports explicit `this` parameter From 7af8f7ecc8cbf89ccb3c4d6cd47558a4b96e2932 Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Thu, 19 Dec 2024 14:07:48 -0500 Subject: [PATCH 10/12] Update apple-clang job matrix Specify that `std::format` is supported for Xcode 16.1. --- .github/generate-job-matrix.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/generate-job-matrix.py b/.github/generate-job-matrix.py index a8ff414f..1c4d4b2b 100644 --- a/.github/generate-job-matrix.py +++ b/.github/generate-job-matrix.py @@ -53,7 +53,9 @@ def make_clang_config( return Configuration(**vars(ret)) -def make_apple_clang_config(os: str, version: str) -> Configuration: +def make_apple_clang_config( + os: str, version: str, std_format_support: bool +) -> Configuration: ret = Configuration( name=f"Apple Clang {version}", os=os, @@ -64,7 +66,7 @@ def make_apple_clang_config(os: str, version: str) -> Configuration: cxx="clang++", ), cxx_modules=False, - std_format_support=False, + std_format_support=std_format_support, ) return ret @@ -95,8 +97,15 @@ configs = { # arm64 runners are expensive; only consider one version if ver == 18 or platform != "arm64" ] - + [make_apple_clang_config("macos-13", ver) for ver in ["15.2"]] - + [make_apple_clang_config("macos-14", ver) for ver in ["16.1"]] + + [ + make_apple_clang_config("macos-13", ver, std_format_support=False) + for ver in ["15.2"] + ] + # std::format is available in Xcode 16.1 or later + + [ + make_apple_clang_config("macos-14", ver, std_format_support=True) + for ver in ["16.1"] + ] + [make_msvc_config(release="14.4", version=194)] } From 8293f023dd8ce411d519e1bfbb3744f899f2b6b0 Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Thu, 19 Dec 2024 14:08:09 -0500 Subject: [PATCH 11/12] Update apple-clang compiler support info for std::format --- docs/getting_started/cpp_compiler_support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started/cpp_compiler_support.md b/docs/getting_started/cpp_compiler_support.md index 525585c3..c5825684 100644 --- a/docs/getting_started/cpp_compiler_support.md +++ b/docs/getting_started/cpp_compiler_support.md @@ -16,7 +16,7 @@ C++ feature: | C++ Feature | C++ version | gcc | clang | apple-clang | MSVC | |-----------------------------------------------------------|:-----------:|:----:|:-----:|:-----------:|:-----------------------------------------:| | **Minimum support** | 20 | 12 | 16 | 15 | 194 :bug:{ title="BEWARE of MSVC Bugs!" } | -| **`std::format`** | 20 | 13 | 17 | None | 194 | +| **`std::format`** | 20 | 13 | 17 | 16 | 194 | | **C++ modules** | 20 | None | 17 | None | None | | **`import std;`** | 23 | None | 18 | None | None | | **Explicit `this` parameter** | 23 | 14 | 18 | None | None | From 7fd24315f1df25950a96c69880cdc3a98705ae26 Mon Sep 17 00:00:00 2001 From: Roth Michaels Date: Thu, 19 Dec 2024 18:34:40 -0500 Subject: [PATCH 12/12] Add .DS_Store to .gitignore This file is added by macOS (e.g. when browsing the directory in Finder). --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 2699986c..2ade9412 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,6 @@ CMakeUserPresets.json # cxxdraft-htmlgen docs/api_reference/src/source/ docs/api_reference/gen + +# macOS files +.DS_Store