Skip to content

Commit d9fbdcd

Browse files
committed
Fix clang-tidy issues
1 parent b33c236 commit d9fbdcd

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

simplecpp.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,10 @@ void simplecpp::TokenList::readfile(Stream &stream, const std::string &filename,
753753
if (line == 0) {
754754
msg += "Line number zero is undefined behavior.";
755755
} else {
756-
const char *support_type = cppstd == CPP26 ? "conditionally supported" : "undefined behavior";
757-
std::string std_name = std_is_c ? getCStdName(cstd) : getCppStdName(cppstd);
758-
msg += "Line numbers above " + std::to_string(maxline) + " are " + support_type + " in " + std_name + ".";
756+
msg += "Line numbers above " + std::to_string(maxline) + " are " +
757+
(cppstd == CPP26 ? "conditionally supported" : "undefined behavior") +
758+
" in " +
759+
(std_is_c ? getCStdName(cstd) : getCppStdName(cppstd)) + ".";
759760
}
760761
simplecpp::Output err{
761762
simplecpp::Output::PORTABILITY_LINE_DIRECTIVE,

test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ static void lineDirective()
29782978
}
29792979

29802980
{
2981-
std::string std_name = "C++26";
2981+
const std::string std_name = "C++26";
29822982

29832983
simplecpp::DUI dui;
29842984
dui.std = "c++26";

0 commit comments

Comments
 (0)