[ObjC] Make C++ triviality type traits available to non-trivial C
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 5 Apr 2018 14:39:57 +0000 (14:39 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 5 Apr 2018 14:39:57 +0000 (14:39 +0000)
commit393b3d85afe3592a3da06147748f18f7b0ae0e9b
tree79fded0f99ceaf37c3553d36e6ef472a988fea5f
parent20140d410fa1bbb3572496304758e0a4019a153f
[ObjC] Make C++ triviality type traits available to non-trivial C
structs.

r326307 and r327870 made changes that allowed using non-trivial C
structs with fields qualified with __strong or __weak. This commit makes
the following C++ triviality type traits available to non-trivial C
structs:

__has_trivial_assign
__has_trivial_move_assign
__has_trivial_copy
__has_trivial_move_constructor
__has_trivial_constructor
__has_trivial_destructor

This reapplies r328680. This commit fixes a bug where the copy/move
__has_trivial_* traits would return false when a volatile type was being
passed. Thanks to Richard Smith for pointing out the mistake.

rdar://problem/33599681

Differential Revision: https://reviews.llvm.org/D44913

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329289 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/TokenKinds.def
lib/Sema/SemaExprCXX.cpp
test/SemaObjC/non-trivial-struct-traits.m [new file with mode: 0644]