================
@@ -2749,6 +2749,41 @@ bool QualType::isTriviallyCopyableType(const ASTContext 
&Context) const {
                                      /*IsCopyConstructible=*/false);
 }
 
+bool QualType::isBitwiseCloneableType(const ASTContext & Context) const {
+  auto CanonicalType = getCanonicalType();
+  if (CanonicalType.hasNonTrivialObjCLifetime())
+    return false;
+  if (CanonicalType->isArrayType())
+    return Context.getBaseElementType(CanonicalType)
+        .isBitwiseCloneableType(Context);
+
+  if (CanonicalType->isIncompleteType())
+    return false;
+
+  if (const auto *RD = CanonicalType->getAsRecordDecl()) { // 
struct/union/class
----------------
ilya-biryukov wrote:

NIT: rewrite to reduce nesting, see [LLVM Code 
Style](https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code).

```
const auto *RD = CanonicalType->getAsRecordDecl();
if (!RD)
  return true;
// ... Rest of the code.
```

https://github.com/llvm/llvm-project/pull/86512
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to