[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
Sat Nov 28 23:36:55 PST 2026


================
@@ -2007,14 +2007,26 @@ ExprResult Sema::BuildExpressionTrait(ExpressionTrait ET, SourceLocation KWLoc,
 }
 
 static std::optional<TypeTrait> StdNameToTypeTrait(StringRef Name) {
+  // std::is_trivially_copy_constructible<T> is implemented in terms of
+  // __is_trivially_constructible(T, const T &).
+  if (Name == "is_trivially_copy_constructible")
+    return TT_IsTriviallyConstructible;
----------------
pesdarshan wrote:

Done. I added an internal-only trait with just a `StdName`, modelled on `IsDeducible`. I removed the special case in `StdNameToTypeTrait` and the `TypeTraitInfo` struct. I rebased onto main after https://github.com/llvm/llvm-project/pull/246180, and it builds and passes `check-clang`. Thanks for the fix.

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


More information about the cfe-commits mailing list