Skip to content

Commit

Permalink
[clang][dataflow] Fix build failure due to -Wunused-variable in Dataf…
Browse files Browse the repository at this point in the history
…lowEnvironment.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.
  • Loading branch information
DamonFool committed Jul 24, 2023
1 parent 05b181d commit e71bae9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit e71bae9

@martinboehme
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

Please sign in to comment.