================ @@ -4016,6 +4016,34 @@ Note that the `size` argument must be a compile time constant. Note that this intrinsic cannot yet be called in a ``constexpr`` context. +``__is_bitwise_cloneable`` +-------------------------- + +A type trait is used to check whether a type can be safely copied by memcpy. + +**Syntax**: + +.. code-block:: c++ + + bool __is_bitwise_cloneable(Type) + +**Description**: + +This trait is similar to `std::is_trivially_copyable`, but additionally allows +to have user-defined constructors, virtual functions and virtual bases. It is up +to the user code to guarantee that a bitwise copy results in non-broken object. + +Objects of bitwise cloneable types can be bitwise copied by memcpy/memmove. The +Clang compiler warrants that this behavior is well defined, and won't be +broken by compiler optimizations. ---------------- ilya-biryukov wrote:
NIT: by compiler optimizations **and sanitizers** https://github.com/llvm/llvm-project/pull/86512 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits