[libc++] Consistency on _LIBCPP_CLANG_VER tests in <type_traits>.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 16 Mar 2021 16:51:24 +0000 (12:51 -0400)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Fri, 19 Mar 2021 14:49:00 +0000 (10:49 -0400)
commit72557476d459969dbee95252e73f6ff1dfcc46c5
tree00898e60413e03929a42b1bee8a684f4d3a03515
parentffb28871037105c899f63726953b6c4e7aa7b148
[libc++] Consistency on _LIBCPP_CLANG_VER tests in <type_traits>.

This came out of my review comments on D97283.

This patch re-enables the use of `__is_fundamental`, `__is_signed`, etc.
on non-Clang compilers. Previously, when we found that a builtin didn't
work on old Clangs, we had been reacting by limiting its use to new Clangs
(i.e., we'd also stop using it on new GCCs and new MSVCs, just because of
the old Clang bug). I claim that this was unintentional.

Notice that on Apple Clang, `_LIBCPP_COMPILER_CLANG` is defined and
`_LIBCPP_CLANG_VER` is not defined (therefore `0` in arithmetic expressions).
We assume that Apple Clang has all the bugs of all the Clangs.

Differential Revision: https://reviews.llvm.org/D98720
libcxx/include/type_traits