[clang] [Clang] disallow attributes on void parameters (PR #124920)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 4 09:16:43 PST 2025
================
@@ -53,3 +53,14 @@ alignas(4) auto PR19252 = 0;
// Check the diagnostic message
class alignas(void) AlignasVoid {}; // expected-error {{invalid application of 'alignas' to an incomplete type 'void'}}
+
+namespace GH108819 {
+void a([[maybe_unused]] void) {} // expected-warning {{attribute 'maybe_unused' cannot be applied to a 'void' parameter}}\
----------------
shafik wrote:
Can we add a test for a member function. also a templated function as well. Other combination if you can come up w/ them should also be tested. We need to do a better job of covering as much as possible.
https://github.com/llvm/llvm-project/pull/124920
More information about the cfe-commits
mailing list