[clang] bceb6a1 - [StaticAnalyzer] Fix -Wunused-variable in SVals.h (NFC)

Jie Fu via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 4 16:42:07 PDT 2023


Author: Jie Fu
Date: 2023-11-05T07:40:44+08:00
New Revision: bceb6a1f2e141be6ed66fa382ee280c2644174fd

URL: https://github.com/llvm/llvm-project/commit/bceb6a1f2e141be6ed66fa382ee280c2644174fd
DIFF: https://github.com/llvm/llvm-project/commit/bceb6a1f2e141be6ed66fa382ee280c2644174fd.diff

LOG: [StaticAnalyzer] Fix -Wunused-variable in SVals.h (NFC)

/llvm-project/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:321:14: error: unused variable 'K' [-Werror,-Wunused-variable]
    SValKind K = data.first.getKind();
             ^
1 error generated.

Added: 
    

Modified: 
    clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
index 5395cd6167b7ce5..c60528b7685fe82 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h
@@ -318,7 +318,7 @@ class LocAsInteger : public NonLoc {
       : NonLoc(LocAsIntegerKind, &data) {
     // We do not need to represent loc::ConcreteInt as LocAsInteger,
     // as it'd collapse into a nonloc::ConcreteInt instead.
-    SValKind K = data.first.getKind();
+    [[maybe_unused]] SValKind K = data.first.getKind();
     assert(K == loc::MemRegionValKind || K == loc::GotoLabelKind);
   }
 


        


More information about the cfe-commits mailing list