Don't show checkLibraryFunction warning for types with unusedvar configuration (#4765)
This commit is contained in:
parent
8af1026696
commit
132ae52428
|
@ -637,6 +637,9 @@ void CheckFunctions::checkLibraryMatchFunctions()
|
||||||
if (mSettings->library.podtype(tok->expressionString()))
|
if (mSettings->library.podtype(tok->expressionString()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (mSettings->library.getTypeCheck("unusedvar", functionName) != Library::TypeCheck::def)
|
||||||
|
continue;
|
||||||
|
|
||||||
const Token* start = tok;
|
const Token* start = tok;
|
||||||
while (Token::Match(start->tokAt(-2), "%name% ::"))
|
while (Token::Match(start->tokAt(-2), "%name% ::"))
|
||||||
start = start->tokAt(-2);
|
start = start->tokAt(-2);
|
||||||
|
|
|
@ -1957,6 +1957,11 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("auto f() {\n"
|
||||||
|
" return std::runtime_error(\"abc\");\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
settings = settings_old;
|
settings = settings_old;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue