diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 35f2dd721..1f7fa463e 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -4360,7 +4360,7 @@ void Tokenizer::simplifyCompoundAssignment() break; } - someOperator |= (tok2->isOp() || (tok2->str() == "?")); + someOperator |= (tok2->isOp() || (tok2->str() == "?") || tok2->isAssignmentOp()); } } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 69884619a..b915b5f49 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -6103,6 +6103,9 @@ private: ASSERT_EQUALS("; a = a + ( b && c ) ;", tokenizeAndStringify("; a+=b&&c;")); ASSERT_EQUALS("; a = a * ( b || c ) ;", tokenizeAndStringify("; a*=b||c;")); ASSERT_EQUALS("; a = a | ( b == c ) ;", tokenizeAndStringify("; a|=b==c;")); + + // #3469 + ASSERT_EQUALS("; a = a + ( b = 1 ) ;", tokenizeAndStringify("; a += b = 1;")); } void simplifyAssignmentInFunctionCall() {