From cfa578cde0314935c6eb5d7fa19ec26390d431dd Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Thu, 31 Aug 2023 14:14:52 -0700 Subject: [PATCH] [Sema] add test cases for D152495 NFC Ensure these don't regress the next time we reland D152495. Link: https://github.com/ClangBuiltLinux/linux/issues/1926 Reviewed By: cor3ntin, MaskRay Differential Revision: https://reviews.llvm.org/D159307 --- clang/test/SemaCXX/warn-unused-variables.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/test/SemaCXX/warn-unused-variables.cpp b/clang/test/SemaCXX/warn-unused-variables.cpp index 4db8bdf12e5de0..1d5aa729dda68a 100644 --- a/clang/test/SemaCXX/warn-unused-variables.cpp +++ b/clang/test/SemaCXX/warn-unused-variables.cpp @@ -46,6 +46,9 @@ void unused_local_static() { static int x = 0; static int y = 0; // expected-warning{{unused variable 'y'}} #pragma unused(x) + static __attribute__((used)) int z; + static __attribute__((unused)) int w; + [[maybe_unused]] static int v; } // PR10168