PR33232: implement support for MSVC's __is_trivially_destructible trait.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 1 Jun 2017 00:28:16 +0000 (00:28 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 1 Jun 2017 00:28:16 +0000 (00:28 +0000)
commite6360f0bfa08c9e713b9378e9661edcbd1f366d0
tree0172153c643b2813038818b50b2310838e9e0650
parent1cf6697b4406b7febeb4f9fdaa49ff494923505b
PR33232: implement support for MSVC's __is_trivially_destructible trait.

Unlike the GCC-compatible __has_trivial_destructor trait, this one computes the
right answer rather than performing the quirky set of checks described in GCC's
documentation (https://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html).

MSVC also has a __has_trivial_destructor trait which is the same as its (and
now Clang's) __is_trivially_destructible trait; we might want to consider
changing the behavior of __has_trivial_destructor if we're targeting an MSVC
platform, but I'm not doing so for now.

While implementing this I found that we were incorrectly rejecting
__is_destructible queries on arrays of unknown bound of incomplete types; that
too is fixed, and I've added similar tests for other traits for good measure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304376 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/TokenKinds.def
include/clang/Basic/TypeTraits.h
lib/Sema/SemaExprCXX.cpp
test/SemaCXX/type-traits.cpp