From b654cf3945b04feda8aa891793d0f20ac1e4087c Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 13 Aug 2024 17:57:59 -0700 Subject: [PATCH 1/2] Make the test suite more friendly to Clang 19 * Fix for regression in `P2268R8_text_formatting_range_formatter` I'm applying a perma-workaround because I suspect this is actually ill-formed, but am not motivated to investigate. GCC also rejects this usage. * Workaround LLVM-104189 in `P2374R4_views_cartesian_product_recommended_practices`` * Comment that LLVM-95311 is fixed in 19.1.0-rc3 on the `FAIL` line in `expected_results.txt` for `std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.compile.pass.cpp`. This allows Clang 19 to pass the test suite with the sole exception of the `has_unique_object_representations` test that `FAIL`s with Clang 17. --- tests/libcxx/expected_results.txt | 1 + .../P2286R8_text_formatting_range_formatter/test.cpp | 8 ++++---- .../test.compile.pass.cpp | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index d1c69193af2..ccf3e90c788 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -373,6 +373,7 @@ std/depr/depr.c.headers/tgmath_h.pass.cpp:2 FAIL # LLVM-95311 [clang] __has_unique_object_representations gives inconsistent answer based on instantiation order # A libc++ product code workaround (using `remove_all_extents_t`) and test coverage were added by LLVM-95314. +# Fixed by llvm/llvm-project#95432 in Clang 19. std/utilities/meta/meta.unary/meta.unary.prop/has_unique_object_representations.compile.pass.cpp:2 FAIL diff --git a/tests/std/tests/P2286R8_text_formatting_range_formatter/test.cpp b/tests/std/tests/P2286R8_text_formatting_range_formatter/test.cpp index a0f9d987226..38652a1fa63 100644 --- a/tests/std/tests/P2286R8_text_formatting_range_formatter/test.cpp +++ b/tests/std/tests/P2286R8_text_formatting_range_formatter/test.cpp @@ -44,9 +44,12 @@ struct std::formatter struct std::formatter, CharT> { +private: + formatter, CharT> underlying; + public: constexpr void set_debug_format() - requires requires { this->underlying.set_debug_format(); } + requires requires { underlying.set_debug_format(); } { underlying.set_debug_format(); } @@ -60,9 +63,6 @@ struct std::formatter, CharT> { auto format(const test::proxy_reference& proxy, FormatContext& ctx) const { return underlying.format(static_cast(proxy), ctx); } - -private: - formatter, CharT> underlying; }; struct FormatAsX {}; diff --git a/tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp b/tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp index 2263873c895..d742c9cb895 100644 --- a/tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp +++ b/tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp @@ -175,7 +175,11 @@ constexpr void check_single_view() { enum class CheckConstAdaptor : bool { no, yes }; +#ifdef __clang__ // TRANSITION, LLVM-104189 +template