[llvm-branch-commits] [libcxx] 1360969 - [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode
Author: Louis Dionne Date: 2024-10-11T15:30:47+08:00 New Revision: 1360969b8125a633a3a8ad734c8a369bd3cf47c2 URL: https://github.com/llvm/llvm-project/commit/1360969b8125a633a3a8ad734c8a369bd3cf47c2 DIFF: https://github.com/llvm/llvm-project/commit/1360969b8125a633a3a8ad734c8a369bd3cf47c2.diff LOG: [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode This is a (very partial) cherry-pick of #101715 to fix this oversight in the LLVM 19 release. Added: Modified: libcxx/docs/FeatureTestMacroTable.rst libcxx/include/version libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp libcxx/utils/generate_feature_test_macro_components.py Removed: diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst index 7f95f0f4e1c17c..cbed6693f0a5d7 100644 --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -266,7 +266,7 @@ Status -- - ``__cpp_lib_polymorphic_allocator````201902L`` -- - -``__cpp_lib_ranges`` ``202207L`` +``__cpp_lib_ranges`` ``202110L`` -- - ``__cpp_lib_remove_cvref`` ``201711L`` -- - diff --git a/libcxx/include/version b/libcxx/include/version index c8a31f77a915e1..76ab6bedafdd0b 100644 --- a/libcxx/include/version +++ b/libcxx/include/version @@ -184,7 +184,7 @@ __cpp_lib_print 202207L __cpp_lib_ranges202211L -202207L // C++20 +202110L // C++20 __cpp_lib_ranges_as_const 202207L __cpp_lib_ranges_as_rvalue 202207L __cpp_lib_ranges_chunk 202202L @@ -429,7 +429,7 @@ __cpp_lib_void_t 201411L # if _LIBCPP_AVAILABILITY_HAS_PMR # define __cpp_lib_polymorphic_allocator 201902L # endif -# define __cpp_lib_ranges 202207L +# define __cpp_lib_ranges 202110L # define __cpp_lib_remove_cvref 201711L # if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC # define __cpp_lib_semaphore 201907L diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp index 6b756535569f6f..65da07ef029253 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp @@ -21,7 +21,7 @@ __cpp_lib_default_template_type_for_algorithm_values202403L [C++26] __cpp_lib_freestanding_algorithm202311L [C++26] __cpp_lib_parallel_algorithm201603L [C++17] -__cpp_lib_ranges202207L [C++20] +__cpp_lib_ranges202110L [C++20] 202211L [C++23] __cpp_lib_ranges_contains 202207L [C++23] __cpp_lib_ranges_find_last 202207L [C++23] @@ -245,8 +245,8 @@ # ifndef __cpp_lib_ranges # error "__cpp_lib_ranges should be defined in c++20" # endif -# if __cpp_lib_ranges != 202207L -# error "__cpp_lib_ranges should have the value 202207L in c++20" +# if __cpp_lib_ranges != 202110L +# error "__cpp_lib_ranges should have the value 202110L in c++20" # endif # ifdef __
[llvm-branch-commits] [libcxx] [release/19.x][libc++] Adjust the version of __cpp_lib_ranges in C++20 mode (PR #109324)
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/109324 >From eb53b498045eca14b64897a329d24b182689fc14 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Thu, 19 Sep 2024 15:40:47 -0400 Subject: [PATCH] [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode This is a (very partial) cherry-pick of #101715 to fix this oversight in the LLVM 19 release. --- libcxx/docs/FeatureTestMacroTable.rst | 2 +- libcxx/include/version | 4 ++-- .../algorithm.version.compile.pass.cpp | 6 +++--- .../functional.version.compile.pass.cpp | 6 +++--- .../iterator.version.compile.pass.cpp | 6 +++--- .../support.limits.general/memory.version.compile.pass.cpp | 6 +++--- .../support.limits.general/ranges.version.compile.pass.cpp | 6 +++--- .../support.limits.general/version.version.compile.pass.cpp | 6 +++--- libcxx/utils/generate_feature_test_macro_components.py | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst index 7f95f0f4e1c17c..cbed6693f0a5d7 100644 --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -266,7 +266,7 @@ Status -- - ``__cpp_lib_polymorphic_allocator````201902L`` -- - -``__cpp_lib_ranges`` ``202207L`` +``__cpp_lib_ranges`` ``202110L`` -- - ``__cpp_lib_remove_cvref`` ``201711L`` -- - diff --git a/libcxx/include/version b/libcxx/include/version index c8a31f77a915e1..76ab6bedafdd0b 100644 --- a/libcxx/include/version +++ b/libcxx/include/version @@ -184,7 +184,7 @@ __cpp_lib_print 202207L __cpp_lib_ranges202211L -202207L // C++20 +202110L // C++20 __cpp_lib_ranges_as_const 202207L __cpp_lib_ranges_as_rvalue 202207L __cpp_lib_ranges_chunk 202202L @@ -429,7 +429,7 @@ __cpp_lib_void_t 201411L # if _LIBCPP_AVAILABILITY_HAS_PMR # define __cpp_lib_polymorphic_allocator 201902L # endif -# define __cpp_lib_ranges 202207L +# define __cpp_lib_ranges 202110L # define __cpp_lib_remove_cvref 201711L # if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC # define __cpp_lib_semaphore 201907L diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp index 6b756535569f6f..65da07ef029253 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp @@ -21,7 +21,7 @@ __cpp_lib_default_template_type_for_algorithm_values202403L [C++26] __cpp_lib_freestanding_algorithm202311L [C++26] __cpp_lib_parallel_algorithm201603L [C++17] -__cpp_lib_ranges202207L [C++20] +__cpp_lib_ranges202110L [C++20] 202211L [C++23] __cpp_lib_ranges_contains 202207L [C++23] __cpp_lib_ranges_find_last 202207L [C++23] @@ -245,8 +245,8 @@ # ifndef __cpp_lib_ranges # error "__cpp_lib_ranges should be defined in c++20" # endif -# if __cpp_lib_ranges != 202207L -# error "__cpp_lib_ranges should have the value 202207L in c++20" +# if __cpp_lib_ranges != 202110L +# error "__cpp_lib_ranges should have the value 202110L in c++20" # endif # ifdef __cpp_lib_ranges_contains diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp index 3c6a23aadc449b..a9e9a
[llvm-branch-commits] [libcxx] [release/19.x][libc++] Adjust the version of __cpp_lib_ranges in C++20 mode (PR #109324)
frederick-vs-ja wrote: @ldionne I force-pushed the branch for resolving conflicts with #109291. Please double-check the changes. https://github.com/llvm/llvm-project/pull/109324 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [release/19.x][libc++] Adjust the version of __cpp_lib_ranges in C++20 mode (PR #109324)
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/109324 >From 1360969b8125a633a3a8ad734c8a369bd3cf47c2 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Thu, 19 Sep 2024 15:40:47 -0400 Subject: [PATCH] [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode This is a (very partial) cherry-pick of #101715 to fix this oversight in the LLVM 19 release. --- libcxx/docs/FeatureTestMacroTable.rst | 2 +- libcxx/include/version | 4 ++-- .../algorithm.version.compile.pass.cpp | 6 +++--- .../functional.version.compile.pass.cpp | 6 +++--- .../iterator.version.compile.pass.cpp | 6 +++--- .../support.limits.general/memory.version.compile.pass.cpp | 6 +++--- .../support.limits.general/ranges.version.compile.pass.cpp | 6 +++--- .../support.limits.general/version.version.compile.pass.cpp | 6 +++--- libcxx/utils/generate_feature_test_macro_components.py | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst index 7f95f0f4e1c17c..cbed6693f0a5d7 100644 --- a/libcxx/docs/FeatureTestMacroTable.rst +++ b/libcxx/docs/FeatureTestMacroTable.rst @@ -266,7 +266,7 @@ Status -- - ``__cpp_lib_polymorphic_allocator````201902L`` -- - -``__cpp_lib_ranges`` ``202207L`` +``__cpp_lib_ranges`` ``202110L`` -- - ``__cpp_lib_remove_cvref`` ``201711L`` -- - diff --git a/libcxx/include/version b/libcxx/include/version index c8a31f77a915e1..76ab6bedafdd0b 100644 --- a/libcxx/include/version +++ b/libcxx/include/version @@ -184,7 +184,7 @@ __cpp_lib_print 202207L __cpp_lib_ranges202211L -202207L // C++20 +202110L // C++20 __cpp_lib_ranges_as_const 202207L __cpp_lib_ranges_as_rvalue 202207L __cpp_lib_ranges_chunk 202202L @@ -429,7 +429,7 @@ __cpp_lib_void_t 201411L # if _LIBCPP_AVAILABILITY_HAS_PMR # define __cpp_lib_polymorphic_allocator 201902L # endif -# define __cpp_lib_ranges 202207L +# define __cpp_lib_ranges 202110L # define __cpp_lib_remove_cvref 201711L # if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC # define __cpp_lib_semaphore 201907L diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp index 6b756535569f6f..65da07ef029253 100644 --- a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp @@ -21,7 +21,7 @@ __cpp_lib_default_template_type_for_algorithm_values202403L [C++26] __cpp_lib_freestanding_algorithm202311L [C++26] __cpp_lib_parallel_algorithm201603L [C++17] -__cpp_lib_ranges202207L [C++20] +__cpp_lib_ranges202110L [C++20] 202211L [C++23] __cpp_lib_ranges_contains 202207L [C++23] __cpp_lib_ranges_find_last 202207L [C++23] @@ -245,8 +245,8 @@ # ifndef __cpp_lib_ranges # error "__cpp_lib_ranges should be defined in c++20" # endif -# if __cpp_lib_ranges != 202207L -# error "__cpp_lib_ranges should have the value 202207L in c++20" +# if __cpp_lib_ranges != 202110L +# error "__cpp_lib_ranges should have the value 202110L in c++20" # endif # ifdef __cpp_lib_ranges_contains diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp index 3c6a23aadc449b..a9e9a
[llvm-branch-commits] [libcxx] [release/19.x][libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)
https://github.com/frederick-vs-ja approved this pull request. Looks like that we should merge this now. https://github.com/llvm/llvm-project/pull/109291 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode (PR #109324)
frederick-vs-ja wrote: I guess 6f6422f4a2b8647a59936c131e50a79906d89510 and cdd608b8f0ce090b3568238387df368751bdbb5d should also be cherry-picked. @tru @ldionne https://github.com/llvm/llvm-project/pull/109324 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)
@@ -77,6 +77,7 @@ Implemented Papers - P2602R2 - Poison Pills are Too Toxic - P1981R0 - Rename ``leap`` to ``leap_second`` - P1982R0 - Rename ``link`` to ``time_zone_link`` +- P2602R2 - Poison Pills are Too Toxic (as DR against C++20) frederick-vs-ja wrote: The line is duplicated. ```suggestion - P2602R2 - Poison Pills are Too Toxic (as DR against C++20) - P1981R0 - Rename ``leap`` to ``leap_second`` - P1982R0 - Rename ``link`` to ``time_zone_link`` ``` https://github.com/llvm/llvm-project/pull/109291 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/109291 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)
@@ -992,6 +992,7 @@ def add_version_header(tc): "name": "__cpp_lib_ranges", "values": { "c++20": 202207, +"c++23": 202211, # P2602R2 Poison Pills are Too Toxic frederick-vs-ja wrote: (Not strictly related to this PR) I think the value is fine in C++23 mode, but perhaps it should be `202110L` in C++20 mode as explained in #101715. https://github.com/llvm/llvm-project/pull/109291 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/20.x: [libc++][test] Backport test skipping for Apple Clang 17 (PR #131506)
https://github.com/frederick-vs-ja milestoned https://github.com/llvm/llvm-project/pull/131506 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/20.x: [libc++][test] Backport test skipping for Apple Clang 17 (PR #131506)
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/131506 Cherry-pick of b552e35a06aef4366a933ea85ad3d4bef71e586a and #131438 to release/20.x. It is observed that Apple Clang 17 has started to be used for CI, even for backporting to release/20.x. So I think we should backport skipping to release/20.x to resolve CI failures. >From bbb319c0bfa2f5a09532f73a9cd11f86acfc849d Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Thu, 30 Jan 2025 12:46:24 -0500 Subject: [PATCH 1/2] [libc++] Forward-proof some tests for AppleClang 17 --- .../new.delete/new.delete.array/sized_delete_array.pass.cpp | 1 + .../new.delete/new.delete.single/sized_delete.pass.cpp | 1 + libcxx/test/std/numerics/c.math/signbit.pass.cpp| 2 +- .../meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp| 2 +- .../meta.unary/meta.unary.prop/is_implicit_lifetime.verify.cpp | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array.pass.cpp index 1d763d6caba6a..01387feed67b6 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array.pass.cpp @@ -14,6 +14,7 @@ // ADDITIONAL_COMPILE_FLAGS(clang-18): -fsized-deallocation // ADDITIONAL_COMPILE_FLAGS(apple-clang-15): -fsized-deallocation // ADDITIONAL_COMPILE_FLAGS(apple-clang-16): -fsized-deallocation +// ADDITIONAL_COMPILE_FLAGS(apple-clang-17): -fsized-deallocation // ADDITIONAL_COMPILE_FLAGS(target=x86_64-w64-windows-gnu): -fsized-deallocation // ADDITIONAL_COMPILE_FLAGS(target=i686-w64-windows-gnu): -fsized-deallocation diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete.pass.cpp index 462037e53374b..06d3b0e5b3c35 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete.pass.cpp @@ -14,6 +14,7 @@ // ADDITIONAL_COMPILE_FLAGS(clang-18): -fsized-deallocation // ADDITIONAL_COMPILE_FLAGS(apple-clang-15): -fsized-deallocation // ADDITIONAL_COMPILE_FLAGS(apple-clang-16): -fsized-deallocation +// ADDITIONAL_COMPILE_FLAGS(apple-clang-17): -fsized-deallocation // ADDITIONAL_COMPILE_FLAGS(target=x86_64-w64-windows-gnu): -fsized-deallocation // ADDITIONAL_COMPILE_FLAGS(target=i686-w64-windows-gnu): -fsized-deallocation diff --git a/libcxx/test/std/numerics/c.math/signbit.pass.cpp b/libcxx/test/std/numerics/c.math/signbit.pass.cpp index 143baf1fec941..b5e63dedf136e 100644 --- a/libcxx/test/std/numerics/c.math/signbit.pass.cpp +++ b/libcxx/test/std/numerics/c.math/signbit.pass.cpp @@ -12,7 +12,7 @@ // UNSUPPORTED: windows // These compilers don't support constexpr `__builtin_signbit` yet. -// UNSUPPORTED: clang-18, clang-19, apple-clang-15, apple-clang-16 +// UNSUPPORTED: clang-18, clang-19, apple-clang-15, apple-clang-16, apple-clang-17 // XFAIL: FROZEN-CXX03-HEADERS-FIXME diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp index 24adec37431e7..681ad13a07dfd 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.pass.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // These compilers don't support __builtin_is_implicit_lifetime yet. -// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16 +// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16, apple-clang-17 // diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.verify.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.verify.cpp index 4bcb10d0b7579..34462f9bf0ec6 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.verify.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_implicit_lifetime.verify.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // These compilers don't support __builtin_is_implicit_lifetime yet. -// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16 +// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16, apple-clang-17 // >From d986fb74a21e735d72931093f27abc098831684f Mon Sep 17 00:00:00 2001 From: "A. Jian
[llvm-branch-commits] [libcxx] release/20.x: [libcxx] Add a missing include for __bit_iterator (#127015) (PR #131382)
https://github.com/frederick-vs-ja approved this pull request. LGTM. I opened #131506 for resolving CI failures with Apple Clang 17, perhaps that patch should be backported first. https://github.com/llvm/llvm-project/pull/131382 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++] Implement std::move_only_function (P0288R9) (PR #94670)
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/94670 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++] Implement std::move_only_function (P0288R9) (PR #94670)
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/94670 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/20.x: [clang] Reject constexpr-unknown values as constant expressions more consistently (PR #130658)
https://github.com/frederick-vs-ja approved this pull request. https://github.com/llvm/llvm-project/pull/130658 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/20.x: [libc++][ci] Update the Windows toolchains to Clang 19 (#129232) (PR #129303)
https://github.com/frederick-vs-ja approved this pull request. https://github.com/llvm/llvm-project/pull/129303 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/20.x: [libc++] Fixes (|multi)_set spaceship operator. (#127326) (PR #127342)
https://github.com/frederick-vs-ja requested changes to this pull request. Let's just backport this fix! https://github.com/llvm/llvm-project/pull/127342 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/20.x: [libc++] Fixes (|multi)_set spaceship operator. (#127326) (PR #127342)
https://github.com/frederick-vs-ja approved this pull request. Let's just backport this fix! https://github.com/llvm/llvm-project/pull/127342 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] Fix a typo (PR #2)
frederick-vs-ja wrote: Hi @bodqhrohro! The typo is still present. https://github.com/llvm/llvm-project/blob/62ec7b8de97a197c2522177a52bdc78205579930/llvm/docs/GettingStarted.rst?plain=1#L548 Would you mind to submit a new PR to fix it? https://github.com/llvm/llvm-project/pull/2 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/20.x: [libc++] Add missing release note for LLVM 20 about zip_view (#134144) (PR #134313)
https://github.com/frederick-vs-ja approved this pull request. https://github.com/llvm/llvm-project/pull/134313 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/20.x: [Clang][AST] Fix HandleLValueBase to deal with references (#140105) (PR #140246)
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/140246 Since P2280R4 Unknown references and pointers was implemented, HandleLValueBase now has to deal with referneces: D.MostDerivedType->getAsCXXRecordDecl() will return a nullptr if D.MostDerivedType is a ReferenceType. The fix is to use getNonReferenceType() to obtain the Pointee Type if we have a reference. (cherry picked from commit 136f2ba2a7bca015ef831c91fb0db5e5e31b7632) >From 6ae8c79ed2c7d1deeb686f1d6e1c48b633e86c61 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 15 May 2025 16:04:37 -0700 Subject: [PATCH] [Clang][AST] Fix HandleLValueBase to deal with references (#140105) Since P2280R4 Unknown references and pointers was implemented, HandleLValueBase now has to deal with referneces: D.MostDerivedType->getAsCXXRecordDecl() will return a nullptr if D.MostDerivedType is a ReferenceType. The fix is to use getNonReferenceType() to obtain the Pointee Type if we have a reference. Fixes: https://github.com/llvm/llvm-project/issues/139452 (cherry picked from commit 136f2ba2a7bca015ef831c91fb0db5e5e31b7632) # Conflicts: # clang/docs/ReleaseNotes.rst --- clang/docs/ReleaseNotes.rst | 2 ++ clang/lib/AST/ExprConstant.cpp| 6 +- .../SemaCXX/constant-expression-p2280r4.cpp | 21 +++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 47ef2f80ac3f2..2f43dc4021fd8 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -909,6 +909,8 @@ Bug Fixes in This Version being deleted has a potentially throwing destructor (#GH118660). - Clang now outputs correct values when #embed data contains bytes with negative signed char values (#GH102798). +- Fix crash due to unknown references and pointer implementation and handling of + base classes. (GH139452) Bug Fixes to Compiler Builtins ^^ diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 23602362eaa79..e0746f4532245 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -3311,7 +3311,11 @@ static bool HandleLValueBase(EvalInfo &Info, const Expr *E, LValue &Obj, return false; // Extract most-derived object and corresponding type. - DerivedDecl = D.MostDerivedType->getAsCXXRecordDecl(); + // FIXME: After implementing P2280R4 it became possible to get references + // here. We do MostDerivedType->getAsCXXRecordDecl() in several other + // locations and if we see crashes in those locations in the future + // it may make more sense to move this fix into Lvalue::set. + DerivedDecl = D.MostDerivedType.getNonReferenceType()->getAsCXXRecordDecl(); if (!CastToDerivedClass(Info, E, Obj, DerivedDecl, D.MostDerivedPathLength)) return false; diff --git a/clang/test/SemaCXX/constant-expression-p2280r4.cpp b/clang/test/SemaCXX/constant-expression-p2280r4.cpp index 6c9a87267109c..87beeb4d3dc84 100644 --- a/clang/test/SemaCXX/constant-expression-p2280r4.cpp +++ b/clang/test/SemaCXX/constant-expression-p2280r4.cpp @@ -179,3 +179,24 @@ namespace extern_reference_used_as_unknown { int y; constinit int& g = (x,y); // expected-warning {{left operand of comma operator has no effect}} } + +namespace GH139452 { +struct Dummy { + explicit operator bool() const noexcept { return true; } +}; + +struct Base { int error; }; +struct Derived : virtual Base { }; + +template +constexpr R get_value() { +const auto& derived_val = Derived{}; +if (derived_val.error != 0) +/* nothing */; +return R{}; +} + +int f() { +return !get_value(); // contextually convert the function call result to bool +} +} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/20.x: [Clang][AST] Fix HandleLValueBase to deal with references (#140105) (PR #140246)
https://github.com/frederick-vs-ja milestoned https://github.com/llvm/llvm-project/pull/140246 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++] Implement std::move_only_function (P0288R9) (PR #94670)
frederick-vs-ja wrote: FYI [P2548R2](https://wg21.link/p2548r2) added relaxing wording to [[func.wrap.general]](https://eel.is/c++draft/func.wrap.general) to allow unwrapping in construction. I think we should implement the allowance for `move_only_function` in C++23 as a DR. We can't unwrap in `function` construction though, IIUC, because its target object is observable. But we can unwrap `function` when constructing a `move_only_function`. https://github.com/llvm/llvm-project/pull/94670 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits