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

Darshan N via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 01:13:03 PST 2026


================
@@ -2071,11 +2087,13 @@ static ExtractedTypeTraitInfo ExtractTypeTraitFromExpression(const Expr *E) {
     const TemplateDecl *D = Ts->getTemplateName().getAsTemplateDecl();
     if (!D || !D->isInStdNamespace())
       return std::nullopt;
-    Trait = StdNameToTypeTrait(D->getIdentifier()->getName());
+    StringRef Name = D->getIdentifier()->getName();
+    Trait = StdNameToTypeTrait(Name);
     if (!Trait)
       return std::nullopt;
     for (const auto &Arg : Ts->template_arguments())
       Args.push_back(Arg.getAsType());
+    AddCopySourceArg(D->getASTContext(), Name);
----------------
pesdarshan wrote:

Thanks, I got it now. I pushed an update. `ExtractedTypeTraitInfo` now carries the std name and the `TT_IsTriviallyConstructible` case checks it, so the `const T&` argument is no longer added. Direct `__is_trivially_constructible(T, const T&)` calls still go through the two-argument check. Let me know if you would like anything else changed.

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


More information about the cfe-commits mailing list