diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp --- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp @@ -376,10 +376,10 @@ Context.getCurrentBuildDirectory(), false); StringRef Message = IsNolintBegin - ? "unmatched 'NOLINTBEGIN' comment without a subsequent 'NOLINTEND' " - "comment" - : "unmatched 'NOLINTEND' comment without a previous 'NOLINTBEGIN' " - "comment"; + ? ("unmatched 'NOLINTBEGIN' comment without a subsequent 'NOLINT" + "END' comment") + : ("unmatched 'NOLINTEND' comment without a previous 'NOLINT" + "BEGIN' comment"); Error.Message = tooling::DiagnosticMessage(Message, SM, Loc); return Error; }