Skip to content

Commit

Permalink
[clang-tidy] enable modernize-raw-string-literal and fix existing e…
Browse files Browse the repository at this point in the history
…rrors (#55675)
  • Loading branch information
SigureMo authored Aug 29, 2023
1 parent 51c3c66 commit 241f97d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ modernize-loop-convert,
-modernize-make-shared,
modernize-make-unique,
-modernize-pass-by-value,
-modernize-raw-string-literal,
modernize-raw-string-literal,
modernize-redundant-void-arg,
-modernize-replace-auto-ptr,
-modernize-replace-random-shuffle,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/eager/auto_code_generator/eager_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ static std::pair<std::string, std::string> GenerateForwardFunctionContents(
if (!output.dispensable()) {
std::string input_name =
output_name.substr(0, output_name.size() - 3);
const char* FWD_OUTS_CONTENT_TEMPLATE = "{ \"%s\", ins[\"%s\"] },";
const char* FWD_OUTS_CONTENT_TEMPLATE = R"({ "%s", ins["%s"] },)";
outs_contents_str += paddle::string::Sprintf(
FWD_OUTS_CONTENT_TEMPLATE, output_name, input_name);
}
Expand All @@ -1690,7 +1690,7 @@ static std::pair<std::string, std::string> GenerateForwardFunctionContents(
"Inplace op %s has no input corresponding to output %s.",
op_type,
output_name));
const char* FWD_OUTS_CONTENT_TEMPLATE = "{ \"%s\", ins[\"%s\"] },";
const char* FWD_OUTS_CONTENT_TEMPLATE = R"({ "%s", ins["%s"] },)";
auto inplace_input_name = forward_inplace_map[output_name];
outs_contents_str += paddle::string::Sprintf(
FWD_OUTS_CONTENT_TEMPLATE, output_name, inplace_input_name);
Expand Down

0 comments on commit 241f97d

Please sign in to comment.