#7182 crash: CheckMemoryLeak::functionReturnType()
This commit is contained in:
parent
246147c6e6
commit
86c9387987
|
@ -344,7 +344,8 @@ CheckMemoryLeak::AllocType CheckMemoryLeak::functionReturnType(const Function* f
|
|||
const Token* tok = tok2->astOperand1();
|
||||
if (Token::Match(tok, ".|::"))
|
||||
tok = tok->astOperand2() ? tok->astOperand2() : tok->astOperand1();
|
||||
varid = tok->varId();
|
||||
if (tok)
|
||||
varid = tok->varId();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5712,6 +5712,14 @@ private:
|
|||
" malloc();\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// #7182 "crash: CheckMemoryLeak::functionReturnType()"
|
||||
check("template<typename... Ts> auto unary_right_comma (Ts... ts) { return (ts , ...); }\n"
|
||||
"template<typename T, typename... Ts> auto binary_left_comma (T x, Ts... ts) { return (x , ... , ts); }\n"
|
||||
"int main() {\n"
|
||||
" unary_right_comma (a);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void smartPointerFunctionParam() {
|
||||
|
|
Loading…
Reference in New Issue