[libcxx-commits] [PATCH] D98720: [libc++] Consistency in _LIBCPP_CLANG_VER tests in <type_traits>

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 18 10:11:52 PDT 2021


Quuxplusone added a comment.

> `_LIBCPP_CLANG_VER` isn't defined for Apple Clang, so branches that were previously disabled, are now enabled

Oh that's just evil. So from our POV they have all the same bugs as Clang, but they pretend to be "not Clang"? :/  I guess that's the only simple approach given how their version numbering doesn't match Clang's.

It does seem like maybe we could keep a mapping like this in `__config`, but I don't know what the magic numbers would need to be. (And it would bit-rot as new Apple Clang versions were released.)

  #if defined(__apple_build_version__)
   #if (__apple_build_version__ < 12340000)
   #define _LIBCPP_CLANG_VER 1200
   #elif (__apple_build_version__ < 12340000)
   #define _LIBCPP_CLANG_VER 1100
   #elif (__apple_build_version__ < 12340000)
   #define _LIBCPP_CLANG_VER 1000
   #else
   #define _LIBCPP_CLANG_VER 100
   #endif
  #endif

Personally, I'm okay with your suggestion to use `_LIBCPP_COMPILER_CLANG` and will update the diff accordingly to poke buildkite. But I agree this has become a can of worms.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98720/new/

https://reviews.llvm.org/D98720



More information about the libcxx-commits mailing list