| 3815 | } |
| 3816 | |
| 3817 | static bool checkEvaluationOrderCpp11(const Token * tok, const Token * tok2, const Token * parent, const Settings & settings) |
| 3818 | { |
| 3819 | if (tok->isAssignmentOp()) // TODO check assignment |
| 3820 | return false; |
| 3821 | if (tok->previous() == tok->astOperand1() && parent->isArithmeticalOp() && parent->isBinaryOp()) { |
| 3822 | if (parent->astParent() && parent->astParent()->isAssignmentOp() && isSameExpression(false, tok->astOperand1(), parent->astParent()->astOperand1(), settings, true, false)) |
| 3823 | return true; |
| 3824 | } |
| 3825 | bool foundUndefined{false}; |
| 3826 | visitAstNodes((parent->astOperand1() != tok2) ? parent->astOperand1() : parent->astOperand2(), [&](const Token *tok3) { |
| 3827 | if (tok3->str() == "&" && !tok3->astOperand2()) |
| 3828 | return ChildrenToVisit::none; // don't handle address-of for now |
| 3829 | if (tok3->str() == "(" && Token::simpleMatch(tok3->previous(), "sizeof")) |
| 3830 | return ChildrenToVisit::none; // don't care about sizeof usage |
| 3831 | if (isSameExpression(false, tok->astOperand1(), tok3, settings, true, false)) |
| 3832 | foundUndefined = true; |
| 3833 | return foundUndefined ? ChildrenToVisit::done : ChildrenToVisit::op1_and_op2; |
| 3834 | }); |
| 3835 | |
| 3836 | return foundUndefined; |
| 3837 | } |
| 3838 | |
| 3839 | static bool checkEvaluationOrderCpp17(const Token * tok, const Token * tok2, const Token * parent, const Settings & settings, bool & foundUnspecified) |
| 3840 | { |
no test coverage detected