-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[libc++][type_traits] Implements "A type trait to detect reference binding to temporary" #128649
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
[libc++][type_traits] Implements "A type trait to detect reference binding to temporary" #128649
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
8be15ab
to
bf9e5d9
Compare
…nding to temporary" Implements partially: P2255R2: A type trait to detect reference binding to temporary llvm#105180 https://eel.is/c++draft/meta.type.synop https://eel.is/c++draft/meta.unary.prop Implented type traits: - [x] `reference_constructs_from_temporary` - [x] `reference_converts_from_temporary`
bf9e5d9
to
ab21883
Compare
libcxx/include/__type_traits/reference_constructs_from_temporary.h
Outdated
Show resolved
Hide resolved
...t/std/utilities/meta/meta.unary/meta.unary.prop/reference_constructs_from_temporary.pass.cpp
Show resolved
Hide resolved
...est/std/utilities/meta/meta.unary/meta.unary.prop/reference_converts_from_temporary.pass.cpp
Outdated
Show resolved
Hide resolved
…ference_binding_to_temporary
…ference_binding_to_temporary
…ference_binding_to_temporary
…ference_binding_to_temporary
…ference_binding_to_temporary
…ference_binding_to_temporary
…ding_to_temporary' of https://github.com/H-G-Hristov/llvm-project into hgh/libcxx/P2255R2-A_type_trait_to_detect_reference_binding_to_temporary
…ference_binding_to_temporary
…ference_binding_to_temporary
Removed workarounds and disabled tests for unsupported compilers:
|
If only the check was broken, can't we just drop the check entirely? |
…ference_binding_to_temporary
Wouldn't this cause build failures in the CI if the the intrinsic isn't available? |
When is it not available? |
On Arm currently, Apple Clang |
…ference_binding_to_temporary
…ference_binding_to_temporary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Some stuffs in the test code are confusing, but I think we can do the cleanup later.
libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/common.h
Outdated
Show resolved
Hide resolved
…ference_binding_to_temporary
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/85/builds/6282 Here is the relevant piece of the build log for the reference
|
I guess we need to revert the drive-by changes. Not sure whether that would be temporary. At the time of last CI for this PR, the "macos (apple-configuration, macos-15)" configuration was using apple-clang-16. But today it changed to use apple-clang-17 and the tests for |
: public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)> {}; | ||
|
||
template <class _Tp, class _Up> | ||
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool reference_constructs_from_temporary_v = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zingam It looks like you forgot to add tests for the _LIBCPP_NO_SPECIALIZATIONS
annotations. Could you add them in a follow-up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll do it.
Implements partially: P2255R2: A type trait to detect reference binding to temporary
Issue: #105180
https://eel.is/c++draft/meta.type.synop
https://eel.is/c++draft/meta.unary.prop
Implented type traits:
reference_constructs_from_temporary
reference_converts_from_temporary
Closes #129049
Minor drive-by tweak to
std::is_implicit_lifetime
tests.