[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 6 02:03:05 PST 2024


================
@@ -2634,16 +2637,29 @@ bool QualType::isTriviallyCopyableType(const ASTContext &Context) const {
 
   if (const auto *RT = CanonicalType->getAs<RecordType>()) {
     if (const auto *ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) {
-      if (!ClassDecl->isTriviallyCopyable()) return false;
+      if (IsCopyConstructible) {
+        return ClassDecl->isTriviallyCopyConstructible();
+      } else {
+        return ClassDecl->isTriviallyCopyable();
+      }
     }
-
     return true;
   }
-
   // No other types can match.
   return false;
 }
 
+bool QualType::isTriviallyCopyableType(const ASTContext &Context) const {
+  return isTriviallyCopyableTypeImpl(*this, Context,
+                                     /*IsCopyConstructible*/ false);
----------------
cor3ntin wrote:

```suggestion
                                     /*IsCopyConstructible=*/false);
```

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


More information about the cfe-commits mailing list