Skip to content

[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
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcxx/docs/Status/Cxx23Issues.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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|","",""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We recorded LWG3823 as "Nothing To Do" because no change was made in the library implementation. But I'm not sure whether this is also OK for LWG3819.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's an observable change it's not "nothing to do", even if there are no changes in the actual library implementation. If there are test changes it almost certainly means it's not "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",""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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>();
Expand Down
Loading