Index: clang-tidy/modernize/RawStringLiteralCheck.cpp =================================================================== --- clang-tidy/modernize/RawStringLiteralCheck.cpp +++ clang-tidy/modernize/RawStringLiteralCheck.cpp @@ -108,7 +108,10 @@ } void RawStringLiteralCheck::registerMatchers(MatchFinder *Finder) { - Finder->addMatcher(stringLiteral().bind("lit"), this); + + Finder->addMatcher( + stringLiteral(unless(hasParent(predefinedExpr()))).bind("lit"), + this); } void RawStringLiteralCheck::check(const MatchFinder::MatchResult &Result) { Index: test/clang-tidy/modernize-raw-string-literal.cpp =================================================================== --- test/clang-tidy/modernize-raw-string-literal.cpp +++ test/clang-tidy/modernize-raw-string-literal.cpp @@ -91,6 +91,10 @@ // CHECK-MESSAGES: :[[@LINE-1]]:32: warning: {{.*}} can be written as a raw string literal // CHECK-FIXES: {{^}}char const *const HexPrintable(R"(@\)");{{$}} +char const *const prettyFunction(__PRETTY_FUNCTION__); +char const *const function(__FUNCTION__); +char const *const func(__func__); + #define TRICK(arg_) #arg_ char const *const MacroBody = TRICK(foo\\bar);