Zachary Henkel
64f0f7e646
__has_trivial_copy should map to __is_trivially_copyable
...
Found during clang 15 RC1 testing due to the new diagnostic added by @royjacobson since clang 14. Uncertain if this fix meets the bar to also be applied to the release branch.
If accepted, I'll need someone with commit access to submit on my behalf.
Reviewed By: royjacobson, aaron.ballman, erichkeane
Differential Revision: https://reviews.llvm.org/D131730
2022-08-13 22:54:52 +03:00
Roy Jacobson
0b89d1d59f
[Sema] Add deprecation warnings for some compiler provided __has_* type traits
...
Some compiler provided type traits like __has_trivial_constructor have been documented
as deprecated for quite some time.
Still, some people apparently still use them, even though mixing them with concepts
and with deleted functions leads to weird results. There's also disagreement about some
edge cases between GCC (which Clang claims to follow) and MSVC.
This patch adds deprecation warnings for the usage of those builtins, except for __has_trivial_destructor
which doesn't have a GCC alternative.
I made the warning on by default, so I had to silence it for some tests but it's not too many.
Some (decade old) history of issues with those builtins:
https://github.com/llvm/llvm-project/issues/18187
https://github.com/llvm/llvm-project/issues/18559
https://github.com/llvm/llvm-project/issues/22161
https://github.com/llvm/llvm-project/issues/33063
The abseil usage of them that triggered me to add this warning:
https://github.com/abseil/abseil-cpp/issues/1201
Weird interaction of those builtins with C++20's conditionally trivial special member functions:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106085
Reviewed By: #clang-language-wg, aaron.ballman
Differential Revision: https://reviews.llvm.org/D129170
2022-07-12 19:24:17 +03:00