File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ struct ReverseTraversal {
225225 continue ;
226226 }
227227 // Simple assign
228- if (assignTok->astParent () == assignTop || assignTok == assignTop) {
228+ if (assignTok->str () == " = " && (assignTok-> astParent () == assignTop || assignTok == assignTop) ) {
229229 Analyzer::Action rhsAction =
230230 analyzer->analyze (assignTok->astOperand2 (), Analyzer::Direction::Reverse);
231231 Analyzer::Action lhsAction =
Original file line number Diff line number Diff line change @@ -820,6 +820,14 @@ class TestOther : public TestFixture {
820820 " STATIC_ASSERT(sizeof(int) == sizeof(FOO));\n "
821821 " }\n " );
822822 ASSERT_EQUALS (" " , errout.str ());
823+
824+ // #11505
825+ check (" void f(uint16_t num, uint8_t radix) {\n "
826+ " int c = num % radix;\n "
827+ " num /= radix;\n "
828+ " if (!num) {}\n "
829+ " }\n " );
830+ ASSERT_EQUALS (" " , errout.str ());
823831 }
824832
825833 void nanInArithmeticExpression () {
You can’t perform that action at this time.
0 commit comments