KEMBAR78
Implement P2255R2 Type Traits To Detect References Binding To Temporaries for Clang by frederick-vs-ja · Pull Request #5537 · microsoft/STL · GitHub
Skip to content

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented May 24, 2025

Resolves #2534. (We traditionally resolve features when they've been implemented for at least one of our first-class supported codegen compilers. #5755 tracks getting this implemented for the other one.)

Notes:

  • Currently this is only enabled for Clang, because MSVC and EDG haven't implemented the necessary intrinsics.
  • There's workaround for LLVM-114344.
  • LWG-3819 has not been implemented. Because Clang's intrinsics haven't covered these cases, and library workaround doesn't seem possible.
  • Test coverage for allocator_arg_t constructors of tuple is missing. It seems to me uses-allocator construction is meaningless for tuple containing references. I've tried to submit an LWG issue to make the allocator_arg_t constructors of tuple<Ts...> deleted when (is_reference_v<Ts> || ...) is true. Edit: LWG-4267.

@StephanTLavavej StephanTLavavej self-assigned this May 27, 2025
@StephanTLavavej StephanTLavavej added the cxx23 C++23 feature label May 27, 2025
@StephanTLavavej StephanTLavavej added the compiler Compiler work involved label Jun 24, 2025
@StephanTLavavej StephanTLavavej removed their assignment Oct 2, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Oct 2, 2025
@StephanTLavavej
Copy link
Member

Thanks, this is great! 😻 I appreciate the comprehensive test coverage and extreme attention to detail in tuple's incredibly ornate set of constructors.

@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Oct 3, 2025
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 395e9a6 into microsoft:main Oct 3, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Oct 3, 2025
@StephanTLavavej
Copy link
Member

Thanks for getting us one step closer to finishing C++23! 😻 🏃 🎉

I've filed #5755 and tracking bugs for MSVC and EDG (after having already emailed them quite some time ago). I resolved #2534 following our usual convention of declaring library victory regardless of whether Clang or MSVC is first to enable library support.

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

Archived in project

Development

Successfully merging this pull request may close these issues.

P2255R2 Type Traits To Detect References Binding To Temporaries

2 participants