This is an archive of the discontinued LLVM Phabricator instance.

Clang support for __is_assignable intrinsic
ClosedPublic

Authored by DaveBartolomeo on May 20 2016, 2:21 PM.

Details

Summary

MSVC now supports the __is_assignable type trait intrinsic, to enable easier and more efficient implementation of the Standard Library's is_assignable trait. As of Visual Studio 2015 Update 3, the VC Standard Library implementation uses the new intrinsic unconditionally. We had already implemented this trait for Clang/C2, so we're upstreaming the change so that mainline Clang can handle the new intrinsic as well.

The implementation is pretty straightforward, due to the previously existing is_nothrow_assignable and is_trivially_assignable. We handle __is_assignable via the same code as the other two, except that we skip the extra checks for nothrow or triviality.

Diff Detail

Repository
rL LLVM

Event Timeline

DaveBartolomeo retitled this revision from to Clang support for __is_assignable intrinsic.
DaveBartolomeo updated this object.
DaveBartolomeo added a reviewer: rnk.
DaveBartolomeo added a subscriber: cfe-commits.
majnemer added inline comments.
lib/Sema/SemaExprCXX.cpp
4523–4525 ↗(On Diff #57987)

I'd remove the braces and sort it above the BTT_IsNothrowAssignable case.

Removed unnecessary braces.
Moved BTT_IsAssignable case to a more clear location.

EricWF added a subscriber: EricWF.May 20 2016, 8:10 PM

Should this have a test in test/Lexer/has_feature_type_traits.cpp?

This revision was automatically updated to reflect the committed changes.