[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 23 03:03:27 PDT 2024
================
@@ -3058,6 +3058,141 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) {
}
}
+static std::optional<QualType> commonTypeImpl(Sema &S,
+ TemplateName BaseTemplate,
+ SourceLocation TemplateLoc,
+ ArrayRef<TemplateArgument> Ts) {
+ auto lookUpCommonType = [&](TemplateArgument T1,
+ TemplateArgument T2) -> std::optional<QualType> {
+ // Don't bother looking for other specializations if both types are
+ // builtins - users aren't allowed to specialize for them
+ if (T1.getAsType()->isBuiltinType() && T2.getAsType()->isBuiltinType())
+ return commonTypeImpl(S, BaseTemplate, TemplateLoc, {T1, T2});
----------------
Sirraide wrote:
Yeah, the recursion seems fine here
https://github.com/llvm/llvm-project/pull/99473
More information about the cfe-commits
mailing list