[libcxx-commits] [PATCH] D77519: Fix __is_pointer builtin type trait to work with Objective-C pointer types.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 6 06:27:45 PDT 2020


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

Thanks for looking into this!



================
Comment at: clang/test/SemaObjC/type-traits-is-pointer.mm:10
+void test_is_pointer() {
+    assert_is_pointer<T>();
+
----------------
You can just use `static_assert` directly here.


================
Comment at: libcxx/include/type_traits:901
+// In clang 10.0.0 and earlier __is_pointer didn't work with Objective-C types.
+#if __has_keyword(__is_pointer) && _LIBCPP_CLANG_VER > 1000
+
----------------
Doesn't `__has_keyword` return a number that can be compared against? `#if __has_keyword(__is_pointer) > some-number` would be better if feasible, because it would handle Clang, AppleClang and any other potential derivative.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77519





More information about the libcxx-commits mailing list