[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:34:06 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:

Added. I'll open a separate PR that converts other uses of `size()` to use `empty()` where appropriate 

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


More information about the cfe-commits mailing list