Files
llvm-project/clang-tools-extra/test/clang-tidy/modernize-raw-string-literal-replace-shorter.cpp
Gabor Horvath 3ac2ad7d6c [clang-tidy] Don't modernize-raw-string-literal if replacement is longer.
Fixes PR30964. The old behavior can be achieved using a setting.

Patch by: Andras Leitereg!

Differential Revision: https://reviews.llvm.org/D28667

llvm-svn: 292938
2017-01-24 15:18:11 +00:00

14 lines
640 B
C++

// RUN: %check_clang_tidy %s modernize-raw-string-literal %t
// Don't replace these, because the raw literal would be longer.
char const *const JustAQuote("quote:\'");
char const *const NeedDelimiter("\":)\"");
char const *const ManyQuotes("quotes:\'\'\'\'");
// CHECK-MESSAGES: :[[@LINE-1]]:30: warning: {{.*}} can be written as a raw string literal
// CHECK-FIXES: {{^}}char const *const ManyQuotes(R"(quotes:'''')");{{$}}
char const *const LongOctal("\042\072\051\042");
// CHECK-MESSAGES: :[[@LINE-1]]:29: warning: {{.*}} can be written as a raw string literal
// CHECK-FIXES: {{^}}char const *const LongOctal(R"lit(":)")lit");{{$}}