Skip to content

Commit

Permalink
Compound assignment operators
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Mar 21, 2024
1 parent 962fe78 commit ab1e46a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8587,7 +8587,7 @@ void Tokenizer::findGarbageCode() const
match2 = match2 || Token::Match(tok->next(), "try|catch|namespace");
}
if (match1 && !tok->isIncDecOp()) {
match2 = match2 || Token::simpleMatch(tok->next(), "=");
match2 = match2 || Token::Match(tok->next(), "%assign%");
}
if (match1 && match2)
syntaxError(tok);
Expand Down
1 change: 1 addition & 0 deletions test/testgarbage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,7 @@ class TestGarbage : public TestFixture {
}
void garbageCode225() {
ASSERT_THROW(checkCode("int n() { c * s0, 0 s0 = c(sizeof = ) }"), InternalError);
ASSERT_THROW(checkCode("int n() { c * s0, 0 s0 = c(sizeof |= ) }"), InternalError);
}

void syntaxErrorFirstToken() {
Expand Down

0 comments on commit ab1e46a

Please sign in to comment.