[Sema] Do not consider warning fixes for non-augmenting fix recording logic

This commit is contained in:
LucianoAlmeida
2021-12-08 23:54:05 -03:00
parent e02836b7cd
commit b250723f58

View File

@@ -11661,9 +11661,16 @@ bool ConstraintSystem::recordFix(ConstraintFix *fix, unsigned impact) {
// current anchor or, in case of anchor being an expression, any of
// its sub-expressions.
llvm::SmallDenseSet<ASTNode> anchors;
for (const auto *fix : Fixes)
anchors.insert(fix->getAnchor());
for (const auto *fix : Fixes) {
// Warning fixes shouldn't be considered, because even if
// such fix is recorded at that anchor this should not
// have any affect in the recording of any other fix.
if (fix->isWarning())
continue;
anchors.insert(fix->getAnchor());
}
bool found = false;
if (auto *expr = getAsExpr(anchor)) {
forEachExpr(expr, [&](Expr *subExpr) -> Expr * {