parent
cb6f234a92
commit
40c2687ac4
@ -529,7 +529,7 @@ static bool iscast(const Token *tok, bool cpp)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (tok->previous() && tok->previous()->isName() && tok->previous()->str() != "return" &&
|
if (tok->previous() && tok->previous()->isName() && tok->previous()->str() != "return" &&
|
||||||
(!cpp || tok->previous()->str() != "throw"))
|
(!cpp || !Token::Match(tok->previous(), "delete|throw")))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Token::simpleMatch(tok->previous(), ">") && tok->previous()->link())
|
if (Token::simpleMatch(tok->previous(), ">") && tok->previous()->link())
|
||||||
|
@ -497,6 +497,12 @@ private:
|
|||||||
"[test.cpp:12]: (warning) Redundant code: Found unused member access.\n"
|
"[test.cpp:12]: (warning) Redundant code: Found unused member access.\n"
|
||||||
"[test.cpp:15]: (warning) Redundant code: Found unused member access.\n",
|
"[test.cpp:15]: (warning) Redundant code: Found unused member access.\n",
|
||||||
errout.str());
|
errout.str());
|
||||||
|
|
||||||
|
check("struct S { void* p; };\n"
|
||||||
|
"void f(S s) {\n"
|
||||||
|
" delete (int*)s.p;\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void vardecl() {
|
void vardecl() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user