[clang] [Clang] Added explanation why is_trivially_copy_constructible evaluated to false (PR #225487)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 23:31:57 PST 2026


================
@@ -2794,6 +2875,22 @@ void Sema::DiagnoseTypeTraitDetails(const Expr *E) {
   case UTT_IsAbstract:
     DiagnoseNonAbstractReason(*this, E->getBeginLoc(), Args[0]);
     break;
+  case TT_IsTriviallyConstructible:
+    if (StdName == "is_trivially_copy_constructible") {
+      // std::is_trivially_copy_constructible<T>
+      if (Args.size() == 1)
+        DiagnoseNonTriviallyCopyConstructibleReason(*this, E->getBeginLoc(),
+                                                    Args[0]);
----------------
zyn0217 wrote:

```suggestion
    if (Args.size() == 1 && StdName == "is_trivially_copy_constructible") {
  DiagnoseNonTriviallyCopyConstructibleReason(*this, E->getBeginLoc(),
                                                    Args[0]);
```

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


More information about the cfe-commits mailing list