Skip to content

Commit 6063baf

Browse files
dmcppcheckclaude
andcommitted
Fix clang-tidy warnings
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent b37f01c commit 6063baf

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎simplecpp.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,9 +2926,9 @@ namespace simplecpp {
29262926
(quote > 0 && !isStringLiteralPrefix(b.substr(0, quote))))
29272927
return;
29282928
const bool isChar = b[quote] == '\'';
2929-
const bool validPrefix = A->name && quote == 0 && isStringLiteralPrefix(A->str()) &&
2930-
!(isChar && A->str().back() == 'R');
2931-
if (!validPrefix)
2929+
const bool rawChar = isChar && A->str().back() == 'R';
2930+
const bool validPrefix = A->name && quote == 0 && isStringLiteralPrefix(A->str());
2931+
if (!validPrefix || rawChar)
29322932
throw invalidHashHash::cannotCombine(loc, macroName, A, B);
29332933
}
29342934
}

‎test.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2582,7 +2582,7 @@ static void hashhash_encoding_prefix()
25822582
static void hashhash_invalid_prefixed_literal()
25832583
{
25842584
const char *const codes[] = {"cat(a,L\"s\")", "cat(a,u8\"s\")", "cat(L,L\"s\")", "cat(R,'c')", "cat(u8R,'c')"};
2585-
for (const char *line : codes) {
2585+
for (const char *const line : codes) {
25862586
const std::string code = std::string("#define cat(a,b) a##b\n") + line + "\n";
25872587
simplecpp::OutputList outputList;
25882588
ASSERT_EQUALS("", preprocess(code.c_str(), &outputList));

0 commit comments

Comments
 (0)