Skip to content

Commit 929f95c

Browse files
Fix #13509 information: --check-library: There is no matching configuration for function T::cbegin() (#8319)
1 parent c364e62 commit 929f95c

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

lib/checkfunctions.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ void CheckFunctions::checkLibraryMatchFunctions()
635635
if (!tok->scope() || !tok->scope()->isExecutable())
636636
continue;
637637

638+
// skip uninstantiated templates
639+
if (tok == tok->scope()->bodyStart && tok->scope()->function && tok->scope()->function->templateDef) {
640+
tok = tok->link();
641+
continue;
642+
}
643+
638644
if (tok->str() == "new")
639645
insideNew = true;
640646
else if (tok->str() == ";")

test/testfunctions.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,6 +2220,12 @@ class TestFunctions : public TestFixture {
22202220
" return b;\n"
22212221
"}\n", s);
22222222
TODO_ASSERT_EQUALS("", "[test.cpp:6:5]: (debug) auto token with no type. [autoNoType]\n", errout_str());
2223+
2224+
check("template <typename T>\n" // #13509
2225+
"void f(const T& t) {\n"
2226+
" t.g();\n"
2227+
"}\n", s);
2228+
ASSERT_EQUALS("", errout_str());
22232229
}
22242230

22252231
void checkUseStandardLibrary1() {

0 commit comments

Comments
 (0)