File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2299,7 +2299,7 @@ void CheckOther::checkIncompleteStatement()
22992299 if (!Token::simpleMatch (tok->astParent (), " ;" ) && !Token::simpleMatch (rtok, " ;" ) &&
23002300 !Token::Match (tok->previous (), " ;|}|{ %any% ;" ) &&
23012301 !(tok->isCpp () && tok->isCast () && !tok->astParent ()) &&
2302- !(!tok->astParent () && Token::Match (tok->previous (), " %name% (" ) && tok->previous ()->isKeyword ()) &&
2302+ !(!tok->astParent () && tok-> astOperand1 () && Token::Match (tok->previous (), " %name% (" ) && tok->previous ()->isKeyword ()) &&
23032303 !Token::simpleMatch (tok->tokAt (-2 ), " for (" ) &&
23042304 !Token::Match (tok->tokAt (-1 ), " %var% [" ) &&
23052305 !(tok->str () == " ," && tok->astParent () && tok->astParent ()->isAssignmentOp ()))
Original file line number Diff line number Diff line change @@ -743,6 +743,11 @@ class TestIncompleteStatement : public TestFixture {
743743 " [test.cpp:4:13]: (warning) Redundant code: Found unused 'noexcept' expression. [constStatement]\n "
744744 " [test.cpp:5:11]: (warning) Redundant code: Found unused 'typeid' expression. [constStatement]\n " ,
745745 errout_str ());
746+
747+ check (" void f() {\n " // #14044
748+ " g<sizeof(wchar_t)>();\n "
749+ " }\n " );
750+ ASSERT_EQUALS (" " , errout_str ());
746751 }
747752
748753 void vardecl () {
You can’t perform that action at this time.
0 commit comments