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

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


================
@@ -1190,6 +1190,11 @@ void Sema::ActOnPragmaAttributePop(SourceLocation PragmaLoc,
 void Sema::AddPragmaAttributes(Scope *S, Decl *D) {
   if (PragmaAttributeStack.empty())
     return;
+
+  if (ParmVarDecl *P = dyn_cast<ParmVarDecl>(D))
----------------
AaronBallman wrote:

```suggestion
  if (const auto *P = dyn_cast<ParmVarDecl>(D))
```

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


More information about the cfe-commits mailing list