[all-commits] [llvm/llvm-project] 725574: [libc++] Consistency on _LIBCPP_CLANG_VER tests in...

Quuxplusone via All-commits all-commits at lists.llvm.org
Fri Mar 19 07:51:06 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 72557476d459969dbee95252e73f6ff1dfcc46c5
      https://github.com/llvm/llvm-project/commit/72557476d459969dbee95252e73f6ff1dfcc46c5
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-03-19 (Fri, 19 Mar 2021)

  Changed paths:
    M libcxx/include/type_traits

  Log Message:
  -----------
  [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




More information about the All-commits mailing list