================
@@ -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;
return llvm::StringSwitch<std::optional<TypeTrait>>(Name)
#define EMIT_STD_NAME_CASES
#include "clang/Basic/BuiltinTraits.inc"
.Default(std::nullopt);
}
-using ExtractedTypeTraitInfo =
- std::optional<std::pair<TypeTrait, llvm::SmallVector<QualType, 1>>>;
+namespace {
+struct TypeTraitInfo {
+ TypeTrait Trait;
+ llvm::SmallVector<QualType, 1> Args;
+ // The std:: name (without "_v") if the trait was spelled as a library trait,
+ // empty if it was spelled as a builtin.
+ StringRef StdName;
+};
+} // namespace
+using ExtractedTypeTraitInfo = std::optional<TypeTraitInfo>;
----------------
pesdarshan wrote:
Done, thanks!
https://github.com/llvm/llvm-project/pull/225487
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits