Skip to content

Commit 45c9034

Browse files
committed
use noneMarkerStartLoc
1 parent 08d332f commit 45c9034

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/Frontend/DiagnosticVerifier.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -642,17 +642,14 @@ DiagnosticVerifier::Result DiagnosticVerifier::verifyFile(unsigned BufferID) {
642642

643643
assert(!FoundDiagnostic.FixIts.empty() &&
644644
"some fix-its should be produced here");
645-
646-
const char *noneStartLoc =
647-
expected.ExpectedEnd -
648-
(fixitExpectationNoneString.size() + 4) /* length of '{{none}}' */;
645+
assert(expected.noneMarkerStartLoc && "none marker location is null");
649646

650647
const char *replStartLoc = nullptr, *replEndLoc = nullptr;
651648
std::string message;
652649
if (expected.Fixits.empty()) {
653650
message = "expected no fix-its";
654-
replStartLoc = noneStartLoc;
655-
replEndLoc = noneStartLoc;
651+
replStartLoc = expected.noneMarkerStartLoc;
652+
replEndLoc = expected.noneMarkerStartLoc;
656653
} else {
657654
message = "unexpected fix-it seen";
658655
replStartLoc = expected.Fixits.front().StartLoc;
@@ -676,8 +673,8 @@ DiagnosticVerifier::Result DiagnosticVerifier::verifyFile(unsigned BufferID) {
676673
actualFixits += " ";
677674
}
678675

679-
emitFixItsError(noneStartLoc, message, replStartLoc, replEndLoc,
680-
actualFixits);
676+
emitFixItsError(expected.noneMarkerStartLoc, message, replStartLoc,
677+
replEndLoc, actualFixits);
681678
}
682679

683680
// Actually remove the diagnostic from the list, so we don't match it

0 commit comments

Comments
 (0)