[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 12:14:45 PDT 2024


================
@@ -3058,6 +3058,133 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) {
   }
 }
 
+static QualType commonTypeImpl(Sema &S, TemplateName BaseTemplate,
+                               SourceLocation TemplateLoc,
+                               ArrayRef<TemplateArgument> Ts) {
+  auto lookUpCommonType = [&](TemplateArgument T1,
+                              TemplateArgument T2) -> QualType {
+    // Don't bother looking for other specializations if both types are
+    // builtins - users aren't allowed to specialize for them
----------------
philnik777 wrote:

We can do that, but I don't think that's part of this project. AFAICT this requires tinkering with the template specialization code and check whether a specialization is allowed to exist. To me that seems like an entire project on its own.

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


More information about the cfe-commits mailing list