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.
This commit is contained in:
Simon Pilgrim 2020-06-11 13:48:42 +01:00
parent 8824913e93
commit f529c0a8a1

View file

@ -19,10 +19,10 @@ class ParamRegionTestConsumer : public ExprEngineConsumer {
void checkForSameParamRegions(MemRegionManager &MRMgr,
const StackFrameContext *SFC,
const ParmVarDecl *PVD) {
for (const auto *D2: PVD->redecls()) {
assert(MRMgr.getVarRegion(PVD, SFC) ==
MRMgr.getVarRegion(cast<ParmVarDecl>(D2), SFC));
}
assert(llvm::all_of(PVD->redecls(), [](const clang::VarDecl *D2) {
return MRMgr.getVarRegion(PVD, SFC) ==
MRMgr.getVarRegion(cast<ParmVarDecl>(D2), SFC)
}));
}
void performTest(const Decl *D) {