[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


================
@@ -1599,13 +1599,66 @@ createTypePackElementParameterList(const ASTContext &C, DeclContext *DC) {
                                        nullptr);
 }
 
+static TemplateParameterList *createCommonTypeList(const ASTContext &C,
+                                                   DeclContext *DC) {
+  // class... Args
+  auto *Args = TemplateTypeParmDecl::Create(
+      C, DC, {}, {}, /*Depth=*/1, /*Position=*/0, /*Id=*/nullptr,
+      /*Typename=*/false, /*ParameterPack=*/true);
+  Args->setImplicit();
+
+  // <class... Args>
+  auto *BaseTemplateList =
+      TemplateParameterList::Create(C, {}, {}, Args, {}, nullptr);
+
+  // template <class... Args> class BaseTemplate
+  auto *BaseTemplate = TemplateTemplateParmDecl::Create(
+      C, DC, {}, /*Depth=*/0, /*Position=*/0, /*ParameterPack=*/false, {},
----------------
Sirraide wrote:

In addition to what I’ve already pointed out above, I’d also use `nullptr` instead of `{}` for the `Id` parameter here to make this less confusing.

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


More information about the cfe-commits mailing list