[PATCH] D127593: [clang] Fix trivially copyable for copy constructor and copy assignment operator

Roy Jacobson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 20 23:56:24 PDT 2022


royjacobson added a comment.

In D127593#3597374 <https://reviews.llvm.org/D127593#3597374>, @sberg wrote:

> You'd only see it when compiling with Clang against MSVC's `<utility>`, where `std::pair` has a deleted copy assignment op (something I approximated with the `struct S` above).  https://godbolt.org/z/bbEqvosvP shows how the behavior changed in Clang trunk. (Interestingly, the behavior is different between MSVC and GCC, and Clang now changed from matching the MSVC behavior to matching the GCC one.)

I've done some more lookup, and I believe the current behavior is correct.
The reasoning is that the behavior in regards to deleted functions in `__has_trivial_assign` is pretty old and is documented here: https://github.com/llvm/llvm-project/issues/33063. As Richard writes there (and as documented in https://clang.llvm.org/docs/LanguageExtensions.html#type-trait-primitives) those type traits are deprecated exactly because they exhibit this weird behavior.

Is it possible to check how often PDFium uses `__has_trivial_assign`? Depending on how large this breakage is we might need to revert and proceed more carefully..


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127593



More information about the cfe-commits mailing list