Index: RawStringLiteralCheck.cpp =================================================================== --- RawStringLiteralCheck.cpp +++ RawStringLiteralCheck.cpp @@ -38,7 +38,8 @@ // Already a raw string literal if R comes before ". const size_t QuotePos = Text.find('"'); assert(QuotePos != StringRef::npos); - return (QuotePos > 0) && (Text[QuotePos - 1] == 'R'); + return (QuotePos != StringRef::npos) && (QuotePos > 0) && + (Text[QuotePos - 1] == 'R'); } bool containsEscapedCharacters(const MatchFinder::MatchResult &Result,