[PATCH] D103623: [Clang] Test case for -Wunused-but-set-variable, warn for volatile.

George Burgess IV via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 14 10:28:00 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG20f7b5f3f9c8: [Clang] Test case for -Wunused-but-set-variable, warn for volatile. (authored by mbenfield, committed by george.burgess.iv).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103623/new/

https://reviews.llvm.org/D103623

Files:
  clang/test/Sema/warn-unused-but-set-variables.c


Index: clang/test/Sema/warn-unused-but-set-variables.c
===================================================================
--- clang/test/Sema/warn-unused-but-set-variables.c
+++ clang/test/Sema/warn-unused-but-set-variables.c
@@ -23,6 +23,10 @@
   int a;
   w = (a = 0);
 
+  // Following gcc, warn for a volatile variable.
+  volatile int b; // expected-warning{{variable 'b' set but not used}}
+  b = 0;
+
   int x;
   x = 0;
   return x;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103623.351917.patch
Type: text/x-patch
Size: 442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210614/1a549097/attachment.bin>


More information about the cfe-commits mailing list