[libc-commits] [PATCH] D148739: [libc] Use __builtin_bit_cast only when src and dest types are trivially copyable

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 20 10:35:17 PDT 2023


sivachandra added inline comments.


================
Comment at: libc/src/__support/CPP/bit.h:39
 #if defined(LLVM_LIBC_HAS_BUILTIN_MEMCPY_INLINE)
+  static_assert(cpp::is_trivially_constructible<To>::value,
+                "This implementation additionally requires destination type to "
----------------
Shouldn't this be outside of the builtin check? Ideally, before the declaration of `to` on line 35?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148739



More information about the libc-commits mailing list