Skip to content

Commit 1faec7b

Browse files
dmcppcheckclaude
andcommitted
Add Token::addToHideSet() for a set of macro names
No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a292a21 commit 1faec7b

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎simplecpp.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,8 +3275,7 @@ namespace simplecpp {
32753275
throw Macro::invalidHashHash::unexpectedNewline(hashHash->location, macro.name());
32763276
for (Token *tok = result.front(); tok; tok = tok->next) {
32773277
tok->location = loc;
3278-
for (const TokenString &name : call.hideSet)
3279-
tok->addToHideSet(name);
3278+
tok->addToHideSet(call.hideSet);
32803279
}
32813280
// whitespace at the end of the replacement list does not count, the
32823281
// expansion is followed by the whitespace after the macro call

‎simplecpp.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ namespace simplecpp {
222222
void addToHideSet(const TokenString &macroName) {
223223
mHideSet.insert(macroName);
224224
}
225+
void addToHideSet(const std::set<TokenString> &hideSet) {
226+
mHideSet.insert(hideSet.cbegin(), hideSet.cend());
227+
}
225228
const std::set<TokenString> &hideSet() const {
226229
return mHideSet;
227230
}

0 commit comments

Comments
 (0)