[clang] [Clang] disallow attributes on void parameters (PR #124920)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 06:32:19 PST 2025


================
@@ -10329,6 +10329,13 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
       }
     }
 
+    if (FTIHasSingleVoidParameter(FTI)) {
+      ParmVarDecl *Param = cast<ParmVarDecl>(FTI.Params[0].Param);
----------------
AaronBallman wrote:

```suggestion
      const auto *Param = cast<ParmVarDecl>(FTI.Params[0].Param);
```

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


More information about the cfe-commits mailing list