[PATCH] D131730: __has_trivial_copy should map to __is_trivially_copyable
Roy Jacobson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Aug 13 12:55:23 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG64f0f7e64600: __has_trivial_copy should map to __is_trivially_copyable (authored by zahen, committed by royjacobson).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131730/new/
https://reviews.llvm.org/D131730
Files:
clang/docs/LanguageExtensions.rst
clang/lib/Sema/SemaExprCXX.cpp
clang/test/SemaCXX/deprecated-builtins.cpp
Index: clang/test/SemaCXX/deprecated-builtins.cpp
===================================================================
--- clang/test/SemaCXX/deprecated-builtins.cpp
+++ clang/test/SemaCXX/deprecated-builtins.cpp
@@ -11,7 +11,7 @@
a = __has_nothrow_constructor(A); // expected-warning-re {{__has_nothrow_constructor {{.*}} use __is_nothrow_constructible}}
a = __has_trivial_assign(A); // expected-warning-re {{__has_trivial_assign {{.*}} use __is_trivially_assignable}}
a = __has_trivial_move_assign(A); // expected-warning-re {{__has_trivial_move_assign {{.*}} use __is_trivially_assignable}}
- a = __has_trivial_copy(A); // expected-warning-re {{__has_trivial_copy {{.*}} use __is_trivially_constructible}}
+ a = __has_trivial_copy(A); // expected-warning-re {{__has_trivial_copy {{.*}} use __is_trivially_copyable}}
a = __has_trivial_constructor(A); // expected-warning-re {{__has_trivial_constructor {{.*}} use __is_trivially_constructible}}
a = __has_trivial_move_constructor(A); // expected-warning-re {{__has_trivial_move_constructor {{.*}} use __is_trivially_constructible}}
a = __has_trivial_destructor(A); // expected-warning-re {{__has_trivial_destructor {{.*}} use __is_trivially_destructible}}
Index: clang/lib/Sema/SemaExprCXX.cpp
===================================================================
--- clang/lib/Sema/SemaExprCXX.cpp
+++ clang/lib/Sema/SemaExprCXX.cpp
@@ -5412,6 +5412,8 @@
Replacement = BTT_IsTriviallyAssignable;
break;
case UTT_HasTrivialCopy:
+ Replacement = UTT_IsTriviallyCopyable;
+ break;
case UTT_HasTrivialDefaultConstructor:
case UTT_HasTrivialMoveConstructor:
Replacement = TT_IsTriviallyConstructible;
Index: clang/docs/LanguageExtensions.rst
===================================================================
--- clang/docs/LanguageExtensions.rst
+++ clang/docs/LanguageExtensions.rst
@@ -1373,7 +1373,7 @@
* ``__has_trivial_move_assign`` (GNU, Microsoft):
Deprecated, use ``__is_trivially_assignable`` instead.
* ``__has_trivial_copy`` (GNU, Microsoft):
- Deprecated, use ``__is_trivially_constructible`` instead.
+ Deprecated, use ``__is_trivially_copyable`` instead.
* ``__has_trivial_constructor`` (GNU, Microsoft):
Deprecated, use ``__is_trivially_constructible`` instead.
* ``__has_trivial_move_constructor`` (GNU, Microsoft):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131730.452449.patch
Type: text/x-patch
Size: 2380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220813/ad026dae/attachment.bin>
More information about the cfe-commits
mailing list