[clang] [Clang] disallow attributes on void parameters (PR #124920)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 31 06:10:27 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff b3458fdec5e183b49c634b72b828630bb6972400 afe40bf1b7095c3758f98327205ea39a1740f48d --extensions cpp,c -- clang/lib/Sema/SemaDecl.cpp clang/test/Misc/pragma-attribute-strict-subjects.c clang/test/SemaCXX/attr-cxx0x.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 9d269f2e4d..63f176f44e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -10331,8 +10331,8 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
for (const auto *A : Param->attrs())
Diag(A->getLoc(), diag::warn_attribute_on_void_param)
<< A << A->getRange();
- }
}
+ }
if (!getLangOpts().CPlusPlus) {
// In C, find all the tag declarations from the prototype and move them
``````````
</details>
https://github.com/llvm/llvm-project/pull/124920
More information about the cfe-commits
mailing list