aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
diff options
context:
space:
mode:
authorsmanna12 <soumi.manna@intel.com>2024-03-26 12:05:40 -0500
committerGitHub <noreply@github.com>2024-03-26 12:05:40 -0500
commit4c4ea249cef8db71d30517aab60a081e764260e1 (patch)
tree6096bf5ecc441542b8ebe1227e5a01d55475e857 /clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
parent81fc43a39878dbd938b45d7735fe6e0fe37b03c3 (diff)
downloadllvm-4c4ea249cef8db71d30517aab60a081e764260e1.zip
llvm-4c4ea249cef8db71d30517aab60a081e764260e1.tar.gz
llvm-4c4ea249cef8db71d30517aab60a081e764260e1.tar.bz2
[NFC][CLANG] Fix static analyzer bugs about unnecessary object copies with auto keyword (#85962)
Reported by Static Analyzer Tool: In clang::dataflow::Environment::initialize(): Using the auto keyword without an & causes the copy of an object of type LambdaCapture
Diffstat (limited to 'clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp')
-rw-r--r--clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
index cc1ebd5..70e0623 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -416,7 +416,7 @@ void Environment::initialize() {
assert(Parent != nullptr);
if (Parent->isLambda()) {
- for (auto Capture : Parent->captures()) {
+ for (const auto &Capture : Parent->captures()) {
if (Capture.capturesVariable()) {
const auto *VarDecl = Capture.getCapturedVar();
assert(VarDecl != nullptr);