Skip to content

Commit c0272fc

Browse files
committed
Fixed #8259 (Don't combine &= for anonymous reference parameters)
1 parent 1f418c1 commit c0272fc

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

lib/tokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ void Tokenizer::combineOperators()
18321832
const char c2 = tok->next()->str()[0];
18331833

18341834
// combine +-*/ and =
1835-
if (c2 == '=' && (std::strchr("+-*/%&|^=!<>", c1))) {
1835+
if (c2 == '=' && (std::strchr("+-*/%|^=!<>", c1))) {
18361836
tok->str(tok->str() + c2);
18371837
tok->deleteNext();
18381838
continue;

test/testtokenize.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ class TestTokenizer : public TestFixture {
911911
ASSERT_EQUALS("; public: ;", tokenizeAndStringify(";public:;", false));
912912
ASSERT_EQUALS("; __published: ;", tokenizeAndStringify(";__published:;", false));
913913
ASSERT_EQUALS("a . public : ;", tokenizeAndStringify("a.public:;", false));
914+
ASSERT_EQUALS("void f ( x & = 2 ) ;", tokenizeAndStringify("void f(x &= 2);", false));
914915
}
915916

916917
void concatenateNegativeNumber() {

0 commit comments

Comments
 (0)