Skip to content
Open
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
6 changes: 6 additions & 0 deletions lib/checkfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,12 @@ void CheckFunctions::checkLibraryMatchFunctions()
if (!tok->scope() || !tok->scope()->isExecutable())
continue;

// skip uninstantiated templates
if (tok == tok->scope()->bodyStart && tok->scope()->function && tok->scope()->function->templateDef) {
tok = tok->link();
continue;
}

if (tok->str() == "new")
insideNew = true;
else if (tok->str() == ";")
Expand Down
6 changes: 6 additions & 0 deletions test/testfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2220,6 +2220,12 @@ class TestFunctions : public TestFixture {
" return b;\n"
"}\n", s);
TODO_ASSERT_EQUALS("", "[test.cpp:6:5]: (debug) auto token with no type. [autoNoType]\n", errout_str());

check("template <typename T>\n" // #13509
"void f(const T& t) {\n"
" t.g();\n"
"}\n", s);
ASSERT_EQUALS("", errout_str());
}

void checkUseStandardLibrary1() {
Expand Down
Loading