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

P2255R2 Type Traits To Detect References Binding To Temporaries #2534

Open
StephanTLavavej opened this issue Feb 8, 2022 · 5 comments
Open
Labels
compiler Compiler work involved cxx23 C++23 feature

Comments

@StephanTLavavej
Copy link
Member

StephanTLavavej commented Feb 8, 2022

P2255R2 Type Traits To Detect References Binding To Temporaries
LWG-3819 reference_meows_from_temporary should not use is_meowible
LWG-4045 tuple can create dangling references from tuple-like
LWG-4148 unique_ptr::operator* should not allow dangling references

Feature-test macro:

#define __cpp_lib_reference_from_temporary 202202L
@StephanTLavavej StephanTLavavej added the cxx23 C++23 feature label Feb 8, 2022
@StephanTLavavej StephanTLavavej added the compiler Compiler work involved label Feb 8, 2022
@StephanTLavavej
Copy link
Member Author

I've contacted the compiler team about getting support for this.

@StephanTLavavej
Copy link
Member Author

  • __reference_constructs_from_temporary has been implemented in Clang 18.
  • __reference_converts_from_temporary is being implemented in Clang.

@cpplearner
Copy link
Contributor

__reference_converts_from_temporary has been implemented in Clang 19 (llvm/llvm-project@2dbe89d).

@frederick-vs-ja
Copy link
Contributor

It's annoying that the number of constructors of tuple is quite large. Also, it's unclear to me how should the allocator-extended constructors behave for tuples containing references, as uses-allocator construction is only defined for objects.

@StephanTLavavej StephanTLavavej moved this from Blocked to Available in STL C++23 Features Jan 29, 2025
@StephanTLavavej
Copy link
Member Author

We've picked up Clang 19 in #5247, so I believe this is now unblocked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Compiler work involved cxx23 C++23 feature
Projects
Status: Available
Development

No branches or pull requests

3 participants