[clang] [clang] Implement a bitwise_copyable builtin type trait. (PR #86512)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 10:36:01 PDT 2024


================
@@ -2667,6 +2667,29 @@ bool QualType::isTriviallyCopyableType(const ASTContext &Context) const {
                                      /*IsCopyConstructible=*/false);
 }
 
+bool QualType::isBitwiseCopyableType(const ASTContext & Context) const {
+  QualType CanonicalType = getCanonicalType();
+  if (CanonicalType->isIncompleteType() || CanonicalType->isDependentType())
----------------
sam-mccall wrote:

should the answer here be dependent if the type is dependent?
similarly should incomplete be an error?

what do other traits do?

https://github.com/llvm/llvm-project/pull/86512


More information about the cfe-commits mailing list