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

Christopher Di Bella via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 31 16:44:26 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
----------------
cjdb wrote:

It is only precedent due to it not having been previously recognised as an issue. It has now been identified and should be addressed, instead of increasing the problem's surface area.

We should do things right, not wrong because "they were done that way previously".

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


More information about the libcxx-commits mailing list