STL
STL copied to clipboard
P2255R2 Type Traits To Detect References Binding To Temporaries
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
I've contacted the compiler team about getting support for this.
__reference_constructs_from_temporaryhas been implemented in Clang 18.__reference_converts_from_temporaryis being implemented in Clang.
__reference_converts_from_temporary has been implemented in Clang 19 (https://github.com/llvm/llvm-project/commit/2dbe89d15046bedcc36a5de1242e20aa91a5e598).
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.
We've picked up Clang 19 in #5247, so I believe this is now unblocked.
In LLVM-118362, it's observed that C++26 core language change WG21-P2748R5 can automatically implement LWG-4148. However, I guess we should implement LWG-4148 in C++23 mode.