[clang] e71bae9 - [clang][dataflow] Fix build failure due to -Wunused-variable in DataflowEnvironment.cpp (NFC)

Jie Fu via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 06:36:35 PDT 2023


Author: Jie Fu
Date: 2023-07-24T21:35:52+08:00
New Revision: e71bae94b04391cb47680622666d448418c0d972

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

LOG: [clang][dataflow] Fix build failure due to -Wunused-variable in DataflowEnvironment.cpp (NFC)

/data/llvm-project/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:125:11: error: unused variable 'StructVal2' [-Werror,-Wunused-variable]
    auto *StructVal2 = cast<StructValue>(&Val2);
          ^
1 error generated.

Added: 
    

Modified: 
    clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
index 5514d25df6cc63..3a91025df6e12a 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -122,7 +122,7 @@ static Value *mergeDistinctValues(QualType Type, Value &Val1,
 
   Value *MergedVal = nullptr;
   if (auto *StructVal1 = dyn_cast<StructValue>(&Val1)) {
-    auto *StructVal2 = cast<StructValue>(&Val2);
+    [[maybe_unused]] auto *StructVal2 = cast<StructValue>(&Val2);
 
     // Values to be merged are always associated with the same location in
     // `LocToVal`. The location stored in `StructVal` should therefore also


        


More information about the cfe-commits mailing list