diff --git a/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp b/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp index 714874b24881..db09aaab9857 100644 --- a/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp @@ -491,9 +491,10 @@ void SimplifyBooleanExprCheck::check(const MatchFinder::MatchResult &Result) { bool containsDiscardedTokens( const ast_matchers::MatchFinder::MatchResult &Result, CharSourceRange CharRange) { - StringRef ReplacementText = + std::string ReplacementText = Lexer::getSourceText(CharRange, *Result.SourceManager, - Result.Context->getLangOpts()).str(); + Result.Context->getLangOpts()) + .str(); Lexer Lex(CharRange.getBegin(), Result.Context->getLangOpts(), ReplacementText.data(), ReplacementText.data(), ReplacementText.data() + ReplacementText.size());