Skip to content

Commit f529c0a

Browse files
committed
Fix unused variable warning. NFCI.
We're only using the D2 iteration value inside the assert (the only component of the loop) - move the entire loop inside the assert by using llvm::all_of.
1 parent 8824913 commit f529c0a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/unittests/StaticAnalyzer/ParamRegionTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class ParamRegionTestConsumer : public ExprEngineConsumer {
1919
void checkForSameParamRegions(MemRegionManager &MRMgr,
2020
const StackFrameContext *SFC,
2121
const ParmVarDecl *PVD) {
22-
for (const auto *D2: PVD->redecls()) {
23-
assert(MRMgr.getVarRegion(PVD, SFC) ==
24-
MRMgr.getVarRegion(cast<ParmVarDecl>(D2), SFC));
25-
}
22+
assert(llvm::all_of(PVD->redecls(), [](const clang::VarDecl *D2) {
23+
return MRMgr.getVarRegion(PVD, SFC) ==
24+
MRMgr.getVarRegion(cast<ParmVarDecl>(D2), SFC)
25+
}));
2626
}
2727

2828
void performTest(const Decl *D) {

0 commit comments

Comments
 (0)