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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 08:24:00 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() &&
----------------
erichkeane wrote:

```suggestion
    if (!TemplateParamLists.empty() && !TemplateParamLists.back()->empty() &&
```

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


More information about the cfe-commits mailing list