[clang] [Clang] Fix a variable shadowing in MapLattice (NFC) (PR #95697)
Shivam Gupta via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 16 03:12:45 PDT 2024
https://github.com/xgupta created https://github.com/llvm/llvm-project/pull/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
>From 60fdd988d16ea624d2fd732cf03ee0fc69a14abc Mon Sep 17 00:00:00 2001
From: Shivam Gupta <shivam98.tkg at gmail.com>
Date: Sun, 16 Jun 2024 15:41:09 +0530
Subject: [PATCH] [Clang] Fix a variable shadowing in MapLattice (NFC)
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 16b0c978779a7..9d7afbe6ae7bf 100644
--- a/clang/include/clang/Analysis/FlowSensitive/MapLattice.h
+++ b/clang/include/clang/Analysis/FlowSensitive/MapLattice.h
@@ -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(); }
More information about the cfe-commits
mailing list