File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -467,9 +467,9 @@ static const Token * getIteratorExpression(const Token * tok)
467467 if (iter2)
468468 return iter2;
469469 } else if (Token::Match (tok, " begin|cbegin|rbegin|crbegin|end|cend|rend|crend (" )) {
470- if (Token::Match (tok->previous (), " . %name% ( )" ))
470+ if (Token::Match (tok->previous (), " . %name% ( ) !!. " ))
471471 return tok->previous ()->astOperand1 ();
472- if (Token::Match (tok, " %name% ( !!)" ))
472+ if (Token::Match (tok, " %name% ( !!)" ) && ! Token::simpleMatch (tok-> linkAt ( 1 ), " ) . " ) )
473473 return tok->next ()->astOperand2 ();
474474 }
475475 return nullptr ;
Original file line number Diff line number Diff line change @@ -705,6 +705,12 @@ class TestStl : public TestFixture {
705705 " if(f().begin()+1 == f().end()+1) {}\n "
706706 " }\n " );
707707 ASSERT_EQUALS (" " , errout.str ());
708+
709+ check (" void f() {\n "
710+ " if (a.begin().x == b.begin().x) {}\n "
711+ " if (begin(a).x == begin(b).x) {}\n "
712+ " }\n " );
713+ ASSERT_EQUALS (" " , errout.str ());
708714 }
709715
710716 void iteratorSameExpression () {
You can’t perform that action at this time.
0 commit comments