[PATCH] D54472: Disable invalid isPodLike<> specialization

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 04:46:45 PST 2018


serge-sans-paille marked an inline comment as done.
serge-sans-paille added inline comments.


================
Comment at: include/llvm/ADT/PointerIntPair.h:133-134
+  static constexpr bool value = true;
+#if !defined(NDEBUG) && (__has_feature(is_trivially_copyable) || (defined(__GNUC__) && __GNUC__ >= 5))
+  static_assert(std::is_trivially_copyable<T>::value, "consistent behavior");
+#endif
----------------
chandlerc wrote:
> The compiler may pass `__has_feature(is_trivially_copyable)` and yet the standard library not provide `std::is_trivially_copyable`. And I don't see any feature test spelled `is_trivially_copyable`? Do you mean `__has_trivially_copy`, which is the Clang and GCC builtin?
> 
> Also, the message is printed on an *error*.
The legacy code for `isPodLike` was using the very same guard without issue, so I tend to think it's okay. +1 for the error stuff, I'll update that.


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

https://reviews.llvm.org/D54472





More information about the llvm-commits mailing list