diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 14bc92ea2..bafcf79b5 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -850,10 +850,10 @@ void CheckOther::checkSuspiciousCaseInSwitch() break; if (Token::Match(tok2, "[;}{]")) break; + if (tok2->str() == "?") finding = nullptr; - - if (Token::Match(tok2, "&&|%oror%")) + else if (Token::Match(tok2, "&&|%oror%")) finding = tok2; } if (finding)