Skip to content

Commit b250723

Browse files
[Sema] Do not consider warning fixes for non-augmenting fix recording logic
1 parent e02836b commit b250723

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11661,9 +11661,16 @@ bool ConstraintSystem::recordFix(ConstraintFix *fix, unsigned impact) {
1166111661
// current anchor or, in case of anchor being an expression, any of
1166211662
// its sub-expressions.
1166311663
llvm::SmallDenseSet<ASTNode> anchors;
11664-
for (const auto *fix : Fixes)
11665-
anchors.insert(fix->getAnchor());
11664+
for (const auto *fix : Fixes) {
11665+
// Warning fixes shouldn't be considered, because even if
11666+
// such fix is recorded at that anchor this should not
11667+
// have any affect in the recording of any other fix.
11668+
if (fix->isWarning())
11669+
continue;
1166611670

11671+
anchors.insert(fix->getAnchor());
11672+
}
11673+
1166711674
bool found = false;
1166811675
if (auto *expr = getAsExpr(anchor)) {
1166911676
forEachExpr(expr, [&](Expr *subExpr) -> Expr * {

0 commit comments

Comments
 (0)