Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7176,7 +7176,7 @@ bool Tokenizer::isScopeNoReturn(const Token *endScopeToken, bool *unknown) const
bool warn = true;
if (Token::simpleMatch(endScopeToken->tokAt(-2), ") ; }")) {
const Token * const ftok = endScopeToken->linkAt(-2)->previous();
if (ftok && (ftok->type() || (ftok->function() && ftok->function()->hasBody()))) // constructor call
if (ftok && (ftok->type() || ftok->function())) // constructor call
warn = false;
}

Expand Down
6 changes: 6 additions & 0 deletions test/testleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2402,6 +2402,12 @@ class TestLeakAutoVar : public TestFixture {
ASSERT_EQUALS("[test.c:3]: (information) --check-library: Function x() should have <noreturn> configuration\n"
"[test.c:4]: (information) --check-library: Function x() should have <use>/<leak-ignore> configuration\n",
errout.str());

check("void cb();\n" // #11190, #11523
"void f() {\n"
" cb();\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}

void configuration2() {
Expand Down