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

<type_traits>: Implement Layout-compatibility and Pointer-interconvertibility Traits #1575

Merged
merged 9 commits into from
Jan 31, 2021

Conversation

MahmoudGSaleh
Copy link
Member

@MahmoudGSaleh MahmoudGSaleh commented Jan 19, 2021

This PR implements P0466R5. It will close #18.

This is ready for review:

  • implement feature calling by compiler intrinsics in <type_traits>
  • implement tests
  • All tests passing (including clang and BE)

The following bugs are used to track related issues:

  • LLVM-48860 - MSVC Compatibility: Implement intrinsics for P0466R5 - Layout-compatibility and Pointer-interconvertibility Traits
  • VSO-1268984 - [EDG] New compiler intrinsics for Layout-compatibility and Pointer-interconvertibility Traits need to be understood by EDG

@MahmoudGSaleh MahmoudGSaleh requested a review from a team as a code owner January 19, 2021 21:54
@StephanTLavavej StephanTLavavej added the cxx20 C++20 feature label Jan 19, 2021
@StephanTLavavej StephanTLavavej marked this pull request as draft January 19, 2021 23:07
@StephanTLavavej StephanTLavavej changed the title <type_traits>: WIP - implement Layout-compatibility and Pointer-interconvertibility Traits <type_traits>: Implement Layout-compatibility and Pointer-interconvertibility Traits Jan 19, 2021
@StephanTLavavej
Copy link
Member

I've marked this PR as a draft and removed WIP from the title.

Many of the test failures are caused by Clang not understanding the new compiler builtins. We should request them by filing an LLVM bug, and then guard the definitions accordingly.

stl/inc/type_traits Outdated Show resolved Hide resolved
stl/inc/type_traits Outdated Show resolved Hide resolved
stl/inc/type_traits Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
stl/inc/type_traits Outdated Show resolved Hide resolved
stl/inc/type_traits Outdated Show resolved Hide resolved
* Fix functions declarations
* Add feature test macros tests
* Update tests
@MahmoudGSaleh
Copy link
Member Author

Analyzing the x86 failures.

@MahmoudGSaleh MahmoudGSaleh marked this pull request as ready for review January 22, 2021 20:39
stl/inc/type_traits Outdated Show resolved Hide resolved
- Updated LLVM bug # for adding intrinsics to clang
- Added condition for using outdated vs renamed intrinsics
- Added new tests per review feedback
Base automatically changed from master to main January 28, 2021 00:35
Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I'll verify and push a change to use static_cast for nullptr, then I'll mirror this to MSVC.

@StephanTLavavej StephanTLavavej merged commit c319a7b into microsoft:main Jan 31, 2021
@StephanTLavavej
Copy link
Member

Thanks for implementing this feature with a comprehensive set of tests, and congratulations on your first microsoft/STL commit! 🎉 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cxx20 C++20 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P0466R5 Layout-Compatibility And Pointer-Interconvertibility Traits
4 participants