From ca69444cef0858ad4facecbfc2232a02422aca9f Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Thu, 25 Jul 2024 16:33:05 +0530 Subject: [PATCH] [Clang] Fix a variable shadowing in MapLattice (NFC) (#95697) 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 --- clang/include/clang/Analysis/FlowSensitive/MapLattice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/include/clang/Analysis/FlowSensitive/MapLattice.h b/clang/include/clang/Analysis/FlowSensitive/MapLattice.h index 16b0c978779a79..b2d147e4ae444b 100644 --- a/clang/include/clang/Analysis/FlowSensitive/MapLattice.h +++ b/clang/include/clang/Analysis/FlowSensitive/MapLattice.h @@ -49,7 +49,7 @@ template 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(); }