Skip to content

Commit 9bb090e

Browse files
xguptayuxuanchen1997
authored andcommitted
[Clang] Fix a variable shadowing in MapLattice (NFC) (#95697)
Summary: 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 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250526
1 parent e979672 commit 9bb090e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/include/clang/Analysis/FlowSensitive/MapLattice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ template <typename Key, typename ElementLattice> class MapLattice {
4949

5050
MapLattice() = default;
5151

52-
explicit MapLattice(Container C) { C = std::move(C); }
52+
explicit MapLattice(Container C) : C{std::move(C)} {};
5353

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

0 commit comments

Comments
 (0)