Modernize: Enable modernize-raw-string-literal in clang-tidy

This commit is contained in:
Artur Ryt 2019-04-02 19:59:00 +02:00
parent 56ae290284
commit 30bb14c657
22 changed files with 60 additions and 61 deletions

View File

@ -11,7 +11,6 @@ misc-*,\
-misc-static-assert,\ -misc-static-assert,\
modernize-*,\ modernize-*,\
-modernize-deprecated-headers,\ -modernize-deprecated-headers,\
-modernize-raw-string-literal,\
-modernize-return-braced-init-list,\ -modernize-return-braced-init-list,\
-modernize-use-auto,\ -modernize-use-auto,\
-modernize-use-noexcept,\ -modernize-use-noexcept,\

View File

@ -182,7 +182,7 @@ int cmCPackNSISGenerator::PackageFiles()
this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", ""); this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC", "");
this->SetOptionIfNotSet("CPACK_NSIS_PAGE_COMPONENTS", ""); this->SetOptionIfNotSet("CPACK_NSIS_PAGE_COMPONENTS", "");
this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL", this->SetOptionIfNotSet("CPACK_NSIS_FULL_INSTALL",
"File /r \"${INST_DIR}\\*.*\""); R"(File /r "${INST_DIR}\*.*")");
this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTIONS", ""); this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTIONS", "");
this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", ""); this->SetOptionIfNotSet("CPACK_NSIS_COMPONENT_SECTION_LIST", "");
this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS", ""); this->SetOptionIfNotSet("CPACK_NSIS_SECTION_SELECTED_VARS", "");
@ -242,7 +242,7 @@ int cmCPackNSISGenerator::PackageFiles()
} }
// Add this component to the various section lists. // Add this component to the various section lists.
sectionList += " !insertmacro \"${MacroName}\" \""; sectionList += R"( !insertmacro "${MacroName}" ")";
sectionList += comp.first; sectionList += comp.first;
sectionList += "\"\n"; sectionList += "\"\n";
selectedVarsList += "Var " + comp.first + "_selected\n"; selectedVarsList += "Var " + comp.first + "_selected\n";
@ -494,10 +494,10 @@ int cmCPackNSISGenerator::InitializeInternal()
std::string execName = *it; std::string execName = *it;
++it; ++it;
std::string linkName = *it; std::string linkName = *it;
str << " CreateShortCut \"$SMPROGRAMS\\$STARTMENU_FOLDER\\" << linkName str << R"( CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\)" << linkName
<< ".lnk\" \"$INSTDIR\\" << cpackNsisExecutablesDirectory << "\\" << R"(.lnk" "$INSTDIR\)" << cpackNsisExecutablesDirectory << "\\"
<< execName << ".exe\"" << std::endl; << execName << ".exe\"" << std::endl;
deleteStr << " Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName deleteStr << R"( Delete "$SMPROGRAMS\$MUI_TEMP\)" << linkName
<< ".lnk\"" << std::endl; << ".lnk\"" << std::endl;
// see if CPACK_CREATE_DESKTOP_LINK_ExeName is on // see if CPACK_CREATE_DESKTOP_LINK_ExeName is on
// if so add a desktop link // if so add a desktop link
@ -507,7 +507,7 @@ int cmCPackNSISGenerator::InitializeInternal()
execName) != cpackPackageDesktopLinksVector.end()) { execName) != cpackPackageDesktopLinksVector.end()) {
str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n"; str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
str << " CreateShortCut \"$DESKTOP\\" << linkName str << " CreateShortCut \"$DESKTOP\\" << linkName
<< ".lnk\" \"$INSTDIR\\" << cpackNsisExecutablesDirectory << "\\" << R"(.lnk" "$INSTDIR\)" << cpackNsisExecutablesDirectory << "\\"
<< execName << ".exe\"" << std::endl; << execName << ".exe\"" << std::endl;
deleteStr << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n"; deleteStr << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
deleteStr << " Delete \"$DESKTOP\\" << linkName << ".lnk\"" deleteStr << " Delete \"$DESKTOP\\" << linkName << ".lnk\""
@ -563,15 +563,15 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
++it; ++it;
std::string linkName = *it; std::string linkName = *it;
if (!url) { if (!url) {
str << " CreateShortCut \"$SMPROGRAMS\\$STARTMENU_FOLDER\\" << linkName str << R"( CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\)" << linkName
<< ".lnk\" \"$INSTDIR\\" << sourceName << "\"" << std::endl; << R"(.lnk" "$INSTDIR\)" << sourceName << "\"" << std::endl;
deleteStr << " Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName deleteStr << R"( Delete "$SMPROGRAMS\$MUI_TEMP\)" << linkName
<< ".lnk\"" << std::endl; << ".lnk\"" << std::endl;
} else { } else {
str << " WriteINIStr \"$SMPROGRAMS\\$STARTMENU_FOLDER\\" << linkName str << R"( WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\)" << linkName
<< ".url\" \"InternetShortcut\" \"URL\" \"" << sourceName << "\"" << R"(.url" "InternetShortcut" "URL" ")" << sourceName << "\""
<< std::endl; << std::endl;
deleteStr << " Delete \"$SMPROGRAMS\\$MUI_TEMP\\" << linkName deleteStr << R"( Delete "$SMPROGRAMS\$MUI_TEMP\)" << linkName
<< ".url\"" << std::endl; << ".url\"" << std::endl;
} }
// see if CPACK_CREATE_DESKTOP_LINK_ExeName is on // see if CPACK_CREATE_DESKTOP_LINK_ExeName is on
@ -581,7 +581,7 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostream& str,
if (this->IsSet(desktop)) { if (this->IsSet(desktop)) {
str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n"; str << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
str << " CreateShortCut \"$DESKTOP\\" << linkName str << " CreateShortCut \"$DESKTOP\\" << linkName
<< ".lnk\" \"$INSTDIR\\" << sourceName << "\"" << std::endl; << R"(.lnk" "$INSTDIR\)" << sourceName << "\"" << std::endl;
deleteStr << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n"; deleteStr << " StrCmp \"$INSTALL_DESKTOP\" \"1\" 0 +2\n";
deleteStr << " Delete \"$DESKTOP\\" << linkName << ".lnk\"" deleteStr << " Delete \"$DESKTOP\\" << linkName << ".lnk\""
<< std::endl; << std::endl;

View File

@ -32,13 +32,13 @@ static const char* cmCTestErrorMatches[] = {
"^Error: ", "^Error: ",
"^Error ", "^Error ",
"[0-9] ERROR: ", "[0-9] ERROR: ",
"^\"[^\"]+\", line [0-9]+: [^Ww]", R"(^"[^"]+", line [0-9]+: [^Ww])",
"^cc[^C]*CC: ERROR File = ([^,]+), Line = ([0-9]+)", "^cc[^C]*CC: ERROR File = ([^,]+), Line = ([0-9]+)",
"^ld([^:])*:([ \\t])*ERROR([^:])*:", "^ld([^:])*:([ \\t])*ERROR([^:])*:",
"^ild:([ \\t])*\\(undefined symbol\\)", R"(^ild:([ \t])*\(undefined symbol\))",
"([^ :]+) : (error|fatal error|catastrophic error)", "([^ :]+) : (error|fatal error|catastrophic error)",
"([^:]+): (Error:|error|undefined reference|multiply defined)", "([^:]+): (Error:|error|undefined reference|multiply defined)",
"([^:]+)\\(([^\\)]+)\\) ?: (error|fatal error|catastrophic error)", R"(([^:]+)\(([^\)]+)\) ?: (error|fatal error|catastrophic error))",
"^fatal error C[0-9]+:", "^fatal error C[0-9]+:",
": syntax error ", ": syntax error ",
"^collect2: ld returned 1 exit status", "^collect2: ld returned 1 exit status",
@ -50,14 +50,14 @@ static const char* cmCTestErrorMatches[] = {
"^CMake Error.*:", "^CMake Error.*:",
":[ \\t]cannot find", ":[ \\t]cannot find",
":[ \\t]can't find", ":[ \\t]can't find",
": \\*\\*\\* No rule to make target [`'].*\\'. Stop", R"(: \*\*\* No rule to make target [`'].*\'. Stop)",
": \\*\\*\\* No targets specified and no makefile found", R"(: \*\*\* No targets specified and no makefile found)",
": Invalid loader fixup for symbol", ": Invalid loader fixup for symbol",
": Invalid fixups exist", ": Invalid fixups exist",
": Can't find library for", ": Can't find library for",
": internal link edit command failed", ": internal link edit command failed",
": Unrecognized option [`'].*\\'", ": Unrecognized option [`'].*\\'",
"\", line [0-9]+\\.[0-9]+: [0-9]+-[0-9]+ \\([^WI]\\)", R"(", line [0-9]+\.[0-9]+: [0-9]+-[0-9]+ \([^WI]\))",
"ld: 0706-006 Cannot find or open library file: -l ", "ld: 0706-006 Cannot find or open library file: -l ",
"ild: \\(argument error\\) can't find library argument ::", "ild: \\(argument error\\) can't find library argument ::",
"^could not be found and will not be loaded.", "^could not be found and will not be loaded.",
@ -66,11 +66,11 @@ static const char* cmCTestErrorMatches[] = {
"ld: 0711-993 Error occurred while writing to the output file:", "ld: 0711-993 Error occurred while writing to the output file:",
"ld: fatal: ", "ld: fatal: ",
"final link failed:", "final link failed:",
"make: \\*\\*\\*.*Error", R"(make: \*\*\*.*Error)",
"make\\[.*\\]: \\*\\*\\*.*Error", R"(make\[.*\]: \*\*\*.*Error)",
"\\*\\*\\* Error code", R"(\*\*\* Error code)",
"nternal error:", "nternal error:",
"Makefile:[0-9]+: \\*\\*\\* .* Stop\\.", R"(Makefile:[0-9]+: \*\*\* .* Stop\.)",
": No such file or directory", ": No such file or directory",
": Invalid argument", ": Invalid argument",
"^The project cannot be built\\.", "^The project cannot be built\\.",
@ -101,19 +101,19 @@ static const char* cmCTestWarningMatches[] = {
"^cc[^C]*CC: WARNING File = ([^,]+), Line = ([0-9]+)", "^cc[^C]*CC: WARNING File = ([^,]+), Line = ([0-9]+)",
"^ld([^:])*:([ \\t])*WARNING([^:])*:", "^ld([^:])*:([ \\t])*WARNING([^:])*:",
"([^:]+): warning ([0-9]+):", "([^:]+): warning ([0-9]+):",
"^\"[^\"]+\", line [0-9]+: [Ww](arning|arnung)", R"(^"[^"]+", line [0-9]+: [Ww](arning|arnung))",
"([^:]+): warning[ \\t]*[0-9]+[ \\t]*:", "([^:]+): warning[ \\t]*[0-9]+[ \\t]*:",
"^(Warning|Warnung) ([0-9]+):", "^(Warning|Warnung) ([0-9]+):",
"^(Warning|Warnung)[ :]", "^(Warning|Warnung)[ :]",
"WARNING: ", "WARNING: ",
"([^ :]+) : warning", "([^ :]+) : warning",
"([^:]+): warning", "([^:]+): warning",
"\", line [0-9]+\\.[0-9]+: [0-9]+-[0-9]+ \\([WI]\\)", R"(", line [0-9]+\.[0-9]+: [0-9]+-[0-9]+ \([WI]\))",
"^cxx: Warning:", "^cxx: Warning:",
".*file: .* has no symbols", ".*file: .* has no symbols",
"([^ :]+):([0-9]+): (Warning|Warnung)", "([^ :]+):([0-9]+): (Warning|Warnung)",
"\\([0-9]*\\): remark #[0-9]*", "\\([0-9]*\\): remark #[0-9]*",
"\".*\", line [0-9]+: remark\\([0-9]*\\):", R"(".*", line [0-9]+: remark\([0-9]*\):)",
"cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*", "cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*",
"^CMake Warning.*:", "^CMake Warning.*:",
"^\\[WARNING\\]", "^\\[WARNING\\]",
@ -121,9 +121,9 @@ static const char* cmCTestWarningMatches[] = {
}; };
static const char* cmCTestWarningExceptions[] = { static const char* cmCTestWarningExceptions[] = {
"/usr/.*/X11/Xlib\\.h:[0-9]+: war.*: ANSI C\\+\\+ forbids declaration", R"(/usr/.*/X11/Xlib\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
"/usr/.*/X11/Xutil\\.h:[0-9]+: war.*: ANSI C\\+\\+ forbids declaration", R"(/usr/.*/X11/Xutil\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
"/usr/.*/X11/XResource\\.h:[0-9]+: war.*: ANSI C\\+\\+ forbids declaration", R"(/usr/.*/X11/XResource\.h:[0-9]+: war.*: ANSI C\+\+ forbids declaration)",
"WARNING 84 :", "WARNING 84 :",
"WARNING 47 :", "WARNING 47 :",
"makefile:", "makefile:",
@ -150,8 +150,8 @@ struct cmCTestBuildCompileErrorWarningRex
static cmCTestBuildCompileErrorWarningRex cmCTestWarningErrorFileLine[] = { static cmCTestBuildCompileErrorWarningRex cmCTestWarningErrorFileLine[] = {
{ "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2 }, { "^Warning W[0-9]+ ([a-zA-Z.\\:/0-9_+ ~-]+) ([0-9]+):", 1, 2 },
{ "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2 }, { "^([a-zA-Z./0-9_+ ~-]+):([0-9]+):", 1, 2 },
{ "^([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, { R"(^([a-zA-Z.\:/0-9_+ ~-]+)\(([0-9]+)\))", 1, 2 },
{ "^[0-9]+>([a-zA-Z.\\:/0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, { R"(^[0-9]+>([a-zA-Z.\:/0-9_+ ~-]+)\(([0-9]+)\))", 1, 2 },
{ "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 }, { "^([a-zA-Z./0-9_+ ~-]+)\\(([0-9]+)\\)", 1, 2 },
{ "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 }, { "\"([a-zA-Z./0-9_+ ~-]+)\", line ([0-9]+)", 1, 2 },
{ "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2 }, { "File = ([a-zA-Z./0-9_+ ~-]+), Line = ([0-9]+)", 1, 2 },

View File

@ -815,9 +815,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
cmsys::RegularExpression valgrindLine("^==[0-9][0-9]*=="); cmsys::RegularExpression valgrindLine("^==[0-9][0-9]*==");
cmsys::RegularExpression vgFIM( cmsys::RegularExpression vgFIM(
"== .*Invalid free\\(\\) / delete / delete\\[\\]"); R"(== .*Invalid free\(\) / delete / delete\[\])");
cmsys::RegularExpression vgFMM( cmsys::RegularExpression vgFMM(
"== .*Mismatched free\\(\\) / delete / delete \\[\\]"); R"(== .*Mismatched free\(\) / delete / delete \[\])");
cmsys::RegularExpression vgMLK1( cmsys::RegularExpression vgMLK1(
"== .*[0-9,]+ bytes in [0-9,]+ blocks are definitely lost" "== .*[0-9,]+ bytes in [0-9,]+ blocks are definitely lost"
" in loss record [0-9,]+ of [0-9,]+"); " in loss record [0-9,]+ of [0-9,]+");

View File

@ -194,7 +194,7 @@ public:
{ {
this->SetLog(&P4->Log, prefix); this->SetLog(&P4->Log, prefix);
this->RegexHeader.compile("^Change ([0-9]+) by (.+)@(.+) on (.*)$"); this->RegexHeader.compile("^Change ([0-9]+) by (.+)@(.+) on (.*)$");
this->RegexDiff.compile("^\\.\\.\\. (.*)#[0-9]+ ([^ ]+)$"); this->RegexDiff.compile(R"(^\.\.\. (.*)#[0-9]+ ([^ ]+)$)");
} }
private: private:

View File

@ -513,7 +513,7 @@ static const yytype_uint8 yyrline[] =
static const char *const yytname[] = static const char *const yytname[] =
{ {
"$end", "error", "$undefined", "cal_ENVCURLY", "cal_NCURLY", "$end", "error", "$undefined", "cal_ENVCURLY", "cal_NCURLY",
"cal_DCURLY", "\"$\"", "\"{\"", "\"}\"", "cal_NAME", "\"\\\\\"", "cal_DCURLY", "\"$\"", "\"{\"", "\"}\"", "cal_NAME", R"("\\")",
"cal_SYMBOL", "\"@\"", "cal_ERROR", "cal_ATNAME", "$accept", "Start", "cal_SYMBOL", "\"@\"", "cal_ERROR", "cal_ATNAME", "$accept", "Start",
"GoalWithOptionalBackSlash", "Goal", "String", "OuterText", "Variable", "GoalWithOptionalBackSlash", "Goal", "String", "OuterText", "Variable",
"EnvVarName", "MultipleIds", "ID", YY_NULLPTR "EnvVarName", "MultipleIds", "ID", YY_NULLPTR

View File

@ -55,7 +55,7 @@ bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args,
(version_min.empty() || version_max.empty())) { (version_min.empty() || version_max.empty())) {
std::ostringstream e; std::ostringstream e;
e << "VERSION \"" << version_string e << "VERSION \"" << version_string
<< "\" does not have a version on both sides of \"...\"."; << R"(" does not have a version on both sides of "...".)";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }

View File

@ -176,7 +176,7 @@ bool cmCMakePolicyCommand::HandleVersionMode(
(version_min.empty() || version_max.empty())) { (version_min.empty() || version_max.empty())) {
std::ostringstream e; std::ostringstream e;
e << "VERSION \"" << version_string e << "VERSION \"" << version_string
<< "\" does not have a version on both sides of \"...\"."; << R"(" does not have a version on both sides of "...".)";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }

View File

@ -196,7 +196,7 @@ void cmExtraKateGenerator::AppendTarget(cmGeneratedFileStream& fout,
{ {
static char JsonSep = ' '; static char JsonSep = ' ';
fout << "\t\t\t" << JsonSep << "{\"name\":\"" << target fout << "\t\t\t" << JsonSep << R"({"name":")" << target
<< "\", " << "\", "
"\"build_cmd\":\"" "\"build_cmd\":\""
<< make << " -C \\\"" << (this->UseNinja ? homeOutputDir : path) << make << " -C \\\"" << (this->UseNinja ? homeOutputDir : path)

View File

@ -263,7 +263,7 @@ void cmExtraSublimeTextGenerator::AppendTarget(
// Regular expression to extract compiler flags from a string // Regular expression to extract compiler flags from a string
// https://gist.github.com/3944250 // https://gist.github.com/3944250
const char* regexString = const char* regexString =
"(^|[ ])-[DIOUWfgs][^= ]+(=\\\"[^\"]+\\\"|=[^\"][^ ]+)?"; R"((^|[ ])-[DIOUWfgs][^= ]+(=\"[^"]+\"|=[^"][^ ]+)?)";
flagRegex.compile(regexString); flagRegex.compile(regexString);
std::string workString = std::string workString =
flagsString + " " + definesString + " " + includesString; flagsString + " " + definesString + " " + includesString;
@ -315,12 +315,12 @@ std::string cmExtraSublimeTextGenerator::BuildMakeCommand(
std::string generator = this->GlobalGenerator->GetName(); std::string generator = this->GlobalGenerator->GetName();
if (generator == "NMake Makefiles") { if (generator == "NMake Makefiles") {
std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile); std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
command += ", \"/NOLOGO\", \"/f\", \""; command += R"(, "/NOLOGO", "/f", ")";
command += makefileName + "\""; command += makefileName + "\"";
command += ", \"" + target + "\""; command += ", \"" + target + "\"";
} else if (generator == "Ninja") { } else if (generator == "Ninja") {
std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile); std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
command += ", \"-f\", \""; command += R"(, "-f", ")";
command += makefileName + "\""; command += makefileName + "\"";
command += ", \"" + target + "\""; command += ", \"" + target + "\"";
} else { } else {
@ -332,7 +332,7 @@ std::string cmExtraSublimeTextGenerator::BuildMakeCommand(
} else { } else {
makefileName = cmSystemTools::ConvertToOutputPath(makefile); makefileName = cmSystemTools::ConvertToOutputPath(makefile);
} }
command += ", \"-f\", \""; command += R"(, "-f", ")";
command += makefileName + "\""; command += makefileName + "\"";
command += ", \"" + target + "\""; command += ", \"" + target + "\"";
} }

View File

@ -895,7 +895,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
/* clang-format off */ /* clang-format off */
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0025) << "\n" w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0025) << "\n"
"Converting " << lang << "Converting " << lang <<
" compiler id \"AppleClang\" to \"Clang\" for compatibility." R"( compiler id "AppleClang" to "Clang" for compatibility.)"
; ;
/* clang-format on */ /* clang-format on */
mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str()); mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
@ -925,7 +925,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
/* clang-format off */ /* clang-format off */
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0047) << "\n" w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0047) << "\n"
"Converting " << lang << "Converting " << lang <<
" compiler id \"QCC\" to \"GNU\" for compatibility." R"( compiler id "QCC" to "GNU" for compatibility.)"
; ;
/* clang-format on */ /* clang-format on */
mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str()); mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
@ -961,7 +961,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
/* clang-format off */ /* clang-format off */
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0089) << "\n" w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0089) << "\n"
"Converting " << lang << "Converting " << lang <<
" compiler id \"XLClang\" to \"XL\" for compatibility." R"( compiler id "XLClang" to "XL" for compatibility.)"
; ;
/* clang-format on */ /* clang-format on */
mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str()); mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str());

View File

@ -906,11 +906,11 @@ void cmGlobalNinjaGenerator::AddCXXCompileCommand(
/* clang-format off */ /* clang-format off */
*this->CompileCommandsStream << "\n{\n" *this->CompileCommandsStream << "\n{\n"
<< " \"directory\": \"" << R"( "directory": ")"
<< cmGlobalGenerator::EscapeJSON(buildFileDir) << "\",\n" << cmGlobalGenerator::EscapeJSON(buildFileDir) << "\",\n"
<< " \"command\": \"" << R"( "command": ")"
<< cmGlobalGenerator::EscapeJSON(commandLine) << "\",\n" << cmGlobalGenerator::EscapeJSON(commandLine) << "\",\n"
<< " \"file\": \"" << R"( "file": ")"
<< cmGlobalGenerator::EscapeJSON(sourceFileName) << "\"\n" << cmGlobalGenerator::EscapeJSON(sourceFileName) << "\"\n"
<< "}"; << "}";
/* clang-format on */ /* clang-format on */

View File

@ -177,13 +177,13 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand(
*this->CommandDatabase << "," << std::endl; *this->CommandDatabase << "," << std::endl;
} }
*this->CommandDatabase << "{" << std::endl *this->CommandDatabase << "{" << std::endl
<< " \"directory\": \"" << R"( "directory": ")"
<< cmGlobalGenerator::EscapeJSON(workingDirectory) << cmGlobalGenerator::EscapeJSON(workingDirectory)
<< "\"," << std::endl << "\"," << std::endl
<< " \"command\": \"" << R"( "command": ")"
<< cmGlobalGenerator::EscapeJSON(compileCommand) << cmGlobalGenerator::EscapeJSON(compileCommand)
<< "\"," << std::endl << "\"," << std::endl
<< " \"file\": \"" << R"( "file": ")"
<< cmGlobalGenerator::EscapeJSON(sourceFile) << "\"" << cmGlobalGenerator::EscapeJSON(sourceFile) << "\""
<< std::endl << std::endl
<< "}"; << "}";

View File

@ -202,7 +202,7 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os,
os << indentNN << "file(GLOB OLD_CONFIG_FILES \"" << installedDir os << indentNN << "file(GLOB OLD_CONFIG_FILES \"" << installedDir
<< this->EFGen->GetConfigImportFileGlob() << "\")\n"; << this->EFGen->GetConfigImportFileGlob() << "\")\n";
os << indentNN << "if(OLD_CONFIG_FILES)\n"; os << indentNN << "if(OLD_CONFIG_FILES)\n";
os << indentNNN << "message(STATUS \"Old export file \\\"" << installedFile os << indentNNN << R"(message(STATUS "Old export file \")" << installedFile
<< "\\\" will be replaced. Removing files [${OLD_CONFIG_FILES}].\")\n"; << "\\\" will be replaced. Removing files [${OLD_CONFIG_FILES}].\")\n";
os << indentNNN << "file(REMOVE ${OLD_CONFIG_FILES})\n"; os << indentNNN << "file(REMOVE ${OLD_CONFIG_FILES})\n";
os << indentNN << "endif()\n"; os << indentNN << "endif()\n";

View File

@ -142,7 +142,7 @@ void cmInstallGenerator::AddInstallRule(
std::string cmInstallGenerator::CreateComponentTest(const char* component, std::string cmInstallGenerator::CreateComponentTest(const char* component,
bool exclude_from_all) bool exclude_from_all)
{ {
std::string result = "\"x${CMAKE_INSTALL_COMPONENT}x\" STREQUAL \"x"; std::string result = R"("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "x)";
result += component; result += component;
result += "x\""; result += "x\"";
if (!exclude_from_all) { if (!exclude_from_all) {

View File

@ -457,7 +457,7 @@ void cmLocalGenerator::GenerateInstallRules()
<< "if(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl << "if(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl
<< " set(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl << " set(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl
<< "endif()" << std::endl << "endif()" << std::endl
<< "string(REGEX REPLACE \"/$\" \"\" CMAKE_INSTALL_PREFIX " << R"(string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX )"
<< "\"${CMAKE_INSTALL_PREFIX}\")" << std::endl << "\"${CMAKE_INSTALL_PREFIX}\")" << std::endl
<< std::endl; << std::endl;

View File

@ -145,7 +145,7 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy,
} else { } else {
std::ostringstream e; std::ostringstream e;
e << defaultVar << " has value \"" << defaultValue e << defaultVar << " has value \"" << defaultValue
<< "\" but must be \"OLD\", \"NEW\", or \"\" (empty)."; << R"(" but must be "OLD", "NEW", or "" (empty).)";
mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false; return false;
} }

View File

@ -214,7 +214,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
} }
cmsys::RegularExpression vx( cmsys::RegularExpression vx(
"^([0-9]+(\\.[0-9]+(\\.[0-9]+(\\.[0-9]+)?)?)?)?$"); R"(^([0-9]+(\.[0-9]+(\.[0-9]+(\.[0-9]+)?)?)?)?$)");
if (!vx.find(version)) { if (!vx.find(version)) {
std::string e = "VERSION \"" + version + "\" format invalid."; std::string e = "VERSION \"" + version + "\" format invalid.";
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e); this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e);

View File

@ -33,7 +33,7 @@ cmRST::cmRST(std::ostream& os, std::string docroot)
, TocTreeDirective("^.. toctree::[ \t]*(.*)$") , TocTreeDirective("^.. toctree::[ \t]*(.*)$")
, ProductionListDirective("^.. productionlist::[ \t]*(.*)$") , ProductionListDirective("^.. productionlist::[ \t]*(.*)$")
, NoteDirective("^.. note::[ \t]*(.*)$") , NoteDirective("^.. note::[ \t]*(.*)$")
, ModuleRST("^#\\[(=*)\\[\\.rst:$") , ModuleRST(R"(^#\[(=*)\[\.rst:$)")
, CMakeRole("(:cmake)?:(" , CMakeRole("(:cmake)?:("
"command|cpack_gen|generator|variable|envvar|module|policy|" "command|cpack_gen|generator|variable|envvar|module|policy|"
"prop_cache|prop_dir|prop_gbl|prop_inst|prop_sf|" "prop_cache|prop_dir|prop_gbl|prop_inst|prop_sf|"

View File

@ -335,7 +335,7 @@ bool cmSetPropertyCommand::HandleCacheMode()
!cmSystemTools::IsOff(this->PropertyValue)) { !cmSystemTools::IsOff(this->PropertyValue)) {
std::ostringstream e; std::ostringstream e;
e << "given non-boolean value \"" << this->PropertyValue e << "given non-boolean value \"" << this->PropertyValue
<< "\" for CACHE property \"ADVANCED\". "; << R"(" for CACHE property "ADVANCED". )";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }

View File

@ -78,7 +78,7 @@ void cmUseMangledMesaCommand::CopyAndFullPathMesaHeader(const char* source,
cmsys::RegularExpression includeLine( cmsys::RegularExpression includeLine(
"^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]"); "^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]");
// regular expression for gl/ or GL/ in a file (match(1) of above) // regular expression for gl/ or GL/ in a file (match(1) of above)
cmsys::RegularExpression glDirLine("(gl|GL)(/|\\\\)([^<\"]+)"); cmsys::RegularExpression glDirLine(R"((gl|GL)(/|\\)([^<"]+))");
// regular expression for gl GL or xmesa in a file (match(1) of above) // regular expression for gl GL or xmesa in a file (match(1) of above)
cmsys::RegularExpression glLine("(gl|GL|xmesa)"); cmsys::RegularExpression glLine("(gl|GL|xmesa)");
while (cmSystemTools::GetLineFromStream(fin, inLine)) { while (cmSystemTools::GetLineFromStream(fin, inLine)) {

View File

@ -23,7 +23,7 @@ cmXMLWriter::~cmXMLWriter()
void cmXMLWriter::StartDocument(const char* encoding) void cmXMLWriter::StartDocument(const char* encoding)
{ {
this->Output << "<?xml version=\"1.0\" encoding=\"" << encoding << "\"?>"; this->Output << R"(<?xml version="1.0" encoding=")" << encoding << "\"?>";
} }
void cmXMLWriter::EndDocument() void cmXMLWriter::EndDocument()