Skip to content

Commit

Permalink
Cast result of std::toupper to char
Browse files Browse the repository at this point in the history
Oddly, std::toupper returns int, not char, which makes
clang-tidy complains about the implicit narrowing.
Make the narrowing explicit to silence the warning.
  • Loading branch information
nchaimov committed Dec 14, 2024
1 parent cfbc553 commit f3c6b93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/salt_instrument_flang_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ class SaltInstrumentAction final : public PluginParseTreeAction {
inputFileExtension = inputFilePath->substr(extPos + 1); // Part of string past last '.'
// Capitalize the first character of inputFileExtension
if (!inputFileExtension.empty()) {
inputFileExtension[0] = std::toupper(inputFileExtension[0]);
inputFileExtension[0] = static_cast<char>(std::toupper(inputFileExtension[0]));
}
}

Expand Down

0 comments on commit f3c6b93

Please sign in to comment.