[PATCH] D96536: Make sure some types are indeed trivially_copyable per llvm::is_trivially_copyable

Danila Malyutin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 03:01:06 PST 2021


danilaml accepted this revision.
danilaml added a comment.
This revision is now accepted and ready to land.

In D96536#2582905 <https://reviews.llvm.org/D96536#2582905>, @serge-sans-paille wrote:

> @danilaml This is certainly not complete, but that's much better than just removing an assert as proposed in https://reviews.llvm.org/D86126. Once that one is accepted, we can move forward and commit https://reviews.llvm.org/D86126

It's better, I just still not completely get why that assert was necessary in the first place. I.e. what exact scenario is it trying to prevent? If we just want all `trivially_copyable` uses to be consistent across compilers, then that assert won't help (at the very least since std:: is not consistent across compiler/std versions). If we just don't want to `memcpy` wrong types but can't use std:: version due to implementation issues on some old compilers, then assert is not helpful either. Although it can be changed to test llvm:: => std::, instead of <=>, so llvm version won't accidentally be more permissive than the std one.


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

https://reviews.llvm.org/D96536



More information about the llvm-commits mailing list