-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[libc++][test] Test LWG3819: reference_meows_from_temporary
should not use is_meowible
#143474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
frederick-vs-ja
wants to merge
3
commits into
llvm:main
Choose a base branch
from
frederick-vs-ja:test-lwg-3819
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-libcxx Author: A. Jiang (frederick-vs-ja) ChangesActually, this LWG issue is not "Nothing To Do". But the changes need to be done by compilers, and library implementations can hardly do anything. Closes #105079. Full diff: https://github.com/llvm/llvm-project/pull/143474.diff 4 Files Affected:
diff --git a/libcxx/docs/Status/Cxx23Issues.csv b/libcxx/docs/Status/Cxx23Issues.csv
index b5c88611559ef..5c3d8f1c477f6 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -261,7 +261,7 @@
"`LWG3733 <https://wg21.link/LWG3733>`__","``ranges::to`` misuses ``cpp17-input-iterator``","2023-02 (Issaquah)","|Complete|","17",""
"`LWG3742 <https://wg21.link/LWG3742>`__","``deque::prepend_range`` needs to permute","2023-02 (Issaquah)","","",""
"`LWG3790 <https://wg21.link/LWG3790>`__","`P1467 <https://wg21.link/P1467>`__ accidentally changed ``nexttoward``'s signature","2023-02 (Issaquah)","","",""
-"`LWG3819 <https://wg21.link/LWG3819>`__","``reference_meows_from_temporary`` should not use ``is_meowible``","2023-02 (Issaquah)","","",""
+"`LWG3819 <https://wg21.link/LWG3819>`__","``reference_meows_from_temporary`` should not use ``is_meowible``","2023-02 (Issaquah)","|Nothing To Do|","",""
"`LWG3821 <https://wg21.link/LWG3821>`__","``uses_allocator_construction_args`` should have overload for ``pair-like``","2023-02 (Issaquah)","|Complete|","18",""
"`LWG3834 <https://wg21.link/LWG3834>`__","Missing ``constexpr`` for ``std::intmax_t`` math functions in ``<cinttypes>``","2023-02 (Issaquah)","","",""
"`LWG3839 <https://wg21.link/LWG3839>`__","``range_formatter``'s ``set_separator``, ``set_brackets``, and ``underlying`` functions should be ``noexcept``","2023-02 (Issaquah)","|Complete|","17",""
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/common.h b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/common.h
index b51444915a5c5..4fba34e3817be 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/common.h
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/common.h
@@ -85,6 +85,14 @@ class ExplicitConversionRef {
explicit operator int&();
};
+struct NonMovable {
+ NonMovable(NonMovable&&) = delete;
+};
+
+struct ConvertsFromNonMovable {
+ ConvertsFromNonMovable(NonMovable);
+};
+
#endif
#endif // TEST_META_UNARY_COMP_COMMON_H
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/reference_constructs_from_temporary.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/reference_constructs_from_temporary.pass.cpp
index 5b3753c67381f..4a09e34b37b1b 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/reference_constructs_from_temporary.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/reference_constructs_from_temporary.pass.cpp
@@ -58,6 +58,7 @@ constexpr bool test() {
assert((std::is_constructible_v<const int&, ConvertsToRef<long, long&>>));
test_reference_constructs_from_temporary<const int&, ConvertsToRef<long, long&>, true>();
#ifndef TEST_COMPILER_GCC
+ // TODO: Remove this guard once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120529 gets fixed.
test_reference_constructs_from_temporary<const int&, ConvertsToRefPrivate<long, long&>, false>();
#endif
@@ -66,6 +67,25 @@ constexpr bool test() {
test_reference_constructs_from_temporary<const int&, long, true>();
+#if defined(TEST_COMPILER_GCC) || (defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 2100)
+ // TODO: Remove this guard once no supported Clang is affected by https://github.com/llvm/llvm-project/issues/114344.
+
+ // Test function references.
+ test_reference_constructs_from_temporary<void (&)(), void(), false>();
+ test_reference_constructs_from_temporary<void (&&)(), void(), false>();
+
+ // Test cv-qualification dropping for scalar prvalues. LWG3819 also covers this.
+ test_reference_constructs_from_temporary<int&&, const int, true>();
+ test_reference_constructs_from_temporary<int&&, volatile int, true>();
+#endif
+
+#if defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 2100
+ // TODO: Remove this guard once supported Clang and GCC have LWG3819 implemented.
+
+ // Test LWG3819: reference_meows_from_temporary should not use is_meowible.
+ test_reference_constructs_from_temporary<ConvertsFromNonMovable&&, NonMovable, true>();
+#endif
+
// Additional checks
test_reference_constructs_from_temporary<const Base&, Derived, true>();
test_reference_constructs_from_temporary<int&&, int, true>();
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary.pass.cpp
index 849e286c8cdab..1b199a497b372 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary.pass.cpp
@@ -58,6 +58,7 @@ constexpr bool test() {
assert((std::is_constructible_v<const int&, ConvertsToRef<long, long&>>));
test_reference_converts_from_temporary<const int&, ConvertsToRef<long, long&>, true>();
#ifndef TEST_COMPILER_GCC
+ // TODO: Remove this guard once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120529 gets fixed.
test_reference_converts_from_temporary<const int&, ConvertsToRefPrivate<long, long&>, false>();
#endif
@@ -66,6 +67,25 @@ constexpr bool test() {
test_reference_converts_from_temporary<const int&, long, true>();
+#if defined(TEST_COMPILER_GCC) || (defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 2100)
+ // TODO: Remove this guard once no supported Clang is affected by https://github.com/llvm/llvm-project/issues/114344.
+
+ // Test function references.
+ test_reference_converts_from_temporary<void (&)(), void(), false>();
+ test_reference_converts_from_temporary<void (&&)(), void(), false>();
+
+ // Test cv-qualification dropping for scalar prvalues. LWG3819 also covers this.
+ test_reference_converts_from_temporary<int&&, const int, true>();
+ test_reference_converts_from_temporary<int&&, volatile int, true>();
+#endif
+
+#if defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 2100
+ // TODO: Remove this guard once supported Clang and GCC have LWG3819 implemented.
+
+ // Test LWG3819: reference_meows_from_temporary should not use is_meowible.
+ test_reference_converts_from_temporary<ConvertsFromNonMovable&&, NonMovable, true>();
+#endif
+
// Additional checks
test_reference_converts_from_temporary<const Base&, Derived, true>();
test_reference_converts_from_temporary<int&&, int, true>();
|
frederick-vs-ja
commented
Jun 10, 2025
This comment was marked as outdated.
This comment was marked as outdated.
…not use `is_meowible` Changes need to be done by compilers, while library implementations can hardly do anything. So the version number actually corresponds to Clang.
d5322bc
to
25aeb85
Compare
frederick-vs-ja
commented
Aug 21, 2025
...est/std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary.pass.cpp
Outdated
Show resolved
Hide resolved
philnik777
reviewed
Sep 1, 2025
...t/std/utilities/meta/meta.unary/meta.unary.prop/reference_constructs_from_temporary.pass.cpp
Outdated
Show resolved
Hide resolved
...est/std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary.pass.cpp
Outdated
Show resolved
Hide resolved
...est/std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary.pass.cpp
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes need to be done by compilers, while library implementations can hardly do anything. So the version number actually corresponds to Clang.
Test coverage for Apple Clang and Android Clang enabled for the next yet-to-exist versions. So that while currently the new test cases are not enable for them, these platforms won't be forgotten when updating CI in the future.
Closes #105079.