| 3871 | } |
| 3872 | |
| 3873 | static const Token *skipUnreachableIfBranch(const Token *tok) |
| 3874 | { |
| 3875 | const Token *condTok = tok->linkAt(-1); |
| 3876 | if (!condTok) |
| 3877 | return tok; |
| 3878 | |
| 3879 | if (!Token::simpleMatch(condTok->tokAt(-1), "if") && !Token::simpleMatch(condTok->tokAt(-2), "if constexpr")) |
| 3880 | return tok; |
| 3881 | |
| 3882 | condTok = condTok->astOperand2(); |
| 3883 | if (!condTok) |
| 3884 | return tok; |
| 3885 | |
| 3886 | if ((condTok->hasKnownIntValue() && condTok->getKnownIntValue() == 0) |
| 3887 | || (unknownLeafValuesAreTemplateArgs(condTok) && condTok->getValue(0))) { |
| 3888 | tok = tok->link(); |
| 3889 | } |
| 3890 | |
| 3891 | return tok; |
| 3892 | } |
| 3893 | |
| 3894 | static const Token *skipUnreachableElseBranch(const Token *tok) |
| 3895 | { |
no test coverage detected