Skip to content
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

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

H-G-Hristov
Copy link
Contributor

@H-G-Hristov H-G-Hristov commented Feb 25, 2025

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

According to #111477 __has_builtin(reference_{constructs|converts|_from_temporary) was broken in Clang 19.1.0 and it was fixed in Clang 19.1.2 with dedbdfb. Workarounds were implemented and test for unsupported compilers disabled.

Closes #129049

Copy link

github-actions bot commented Feb 25, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P2255R2-A_type_trait_to_detect_reference_binding_to_temporary branch 8 times, most recently from 8be15ab to bf9e5d9 Compare February 25, 2025 10:26
…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`
@H-G-Hristov H-G-Hristov force-pushed the hgh/libcxx/P2255R2-A_type_trait_to_detect_reference_binding_to_temporary branch from bf9e5d9 to ab21883 Compare February 25, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[libc++] P2255R2: Implement type traits
2 participants