We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8af1026 commit 132ae52Copy full SHA for 132ae52
2 files changed
lib/checkfunctions.cpp
@@ -637,6 +637,9 @@ void CheckFunctions::checkLibraryMatchFunctions()
637
if (mSettings->library.podtype(tok->expressionString()))
638
continue;
639
640
+ if (mSettings->library.getTypeCheck("unusedvar", functionName) != Library::TypeCheck::def)
641
+ continue;
642
+
643
const Token* start = tok;
644
while (Token::Match(start->tokAt(-2), "%name% ::"))
645
start = start->tokAt(-2);
test/testfunctions.cpp
@@ -1957,6 +1957,11 @@ class TestFunctions : public TestFixture {
1957
"}\n");
1958
ASSERT_EQUALS("", errout.str());
1959
1960
+ check("auto f() {\n"
1961
+ " return std::runtime_error(\"abc\");\n"
1962
+ "}\n");
1963
+ ASSERT_EQUALS("", errout.str());
1964
1965
settings = settings_old;
1966
}
1967
0 commit comments