================
@@ -2006,15 +2006,30 @@ ExprResult Sema::BuildExpressionTrait(ExpressionTrait 
ET, SourceLocation KWLoc,
       ExpressionTraitExpr(KWLoc, ET, Queried, Value, RParen, Context.BoolTy);
 }
 
+// std::is_trivially_copy_constructible<T> is
+// __is_trivially_constructible(T, const T &). It is not in the generated table
+// because the std trait takes only T. Callers tell it apart from the builtin
+// by the std name recorded in ExtractedTypeTraitInfo.
+static constexpr StringRef TriviallyCopyConstructibleName =
+    "is_trivially_copy_constructible";
+
 static std::optional<TypeTrait> StdNameToTypeTrait(StringRef Name) {
+  if (Name == TriviallyCopyConstructibleName)
+    return TT_IsTriviallyConstructible;
----------------
pesdarshan wrote:

I moved the mapping into `BuiltinTraits.td` by giving 
`IsTriviallyConstructible` StdName = "is_trivially_copy_constructible" so the 
generated table handles it. Is that what you meant? Also one concern a trait 
only has one `StdName` so this would stop us from mapping 
`std::is_trivially_constructible` later?

https://github.com/llvm/llvm-project/pull/225487
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to