[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 08:26:11 PST 2024


================
@@ -9759,7 +9759,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
   SmallVector<TemplateParameterList *, 4> TemplateParamLists;
   llvm::append_range(TemplateParamLists, TemplateParamListsRef);
   if (TemplateParameterList *Invented = D.getInventedTemplateParameterList()) {
-    if (!TemplateParamLists.empty() &&
+    if (!TemplateParamLists.empty() && TemplateParamLists.back()->size() &&
----------------
sdkrystian wrote:

Unfortunately, `TemplateParameterList` doesn't have an `empty` member function. I can add one though, since we perform this check fairly often.

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


More information about the cfe-commits mailing list