Skip to content

Commit

Permalink
[Clang] Fix a variable shadowing in MapLattice (NFC) (#95697)
Browse files Browse the repository at this point in the history
Reported in https://pvs-studio.com/en/blog/posts/cpp/1126/, fragment
N10.

The PVS-Studio warning:
V570 The 'C' variable is assigned to itself. MapLattice.h:52
  • Loading branch information
xgupta authored Jul 25, 2024
1 parent 9107338 commit ca69444
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/include/clang/Analysis/FlowSensitive/MapLattice.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ template <typename Key, typename ElementLattice> class MapLattice {

MapLattice() = default;

explicit MapLattice(Container C) { C = std::move(C); }
explicit MapLattice(Container C) : C{std::move(C)} {};

// The `bottom` element is the empty map.
static MapLattice bottom() { return MapLattice(); }
Expand Down

0 comments on commit ca69444

Please sign in to comment.