Added regression test for Ticket 7981.

This commit is contained in:
orbitcowboy 2022-01-18 13:09:02 +01:00
parent 9483ea4198
commit b6c010c17e
1 changed files with 12 additions and 0 deletions

View File

@ -6967,6 +6967,18 @@ private:
" return f<X>(s);\n"
"}");
ASSERT_EQUALS("", errout.str());
// #7981 - False positive redundantCopyLocalConst - const ref argument to ctor
check("class CD {\n"
" public:\n"
" CD(const CD&);\n"
" static const CD& getOne();\n"
"};\n"
" \n"
"void foo() {\n"
" const CD cd(CD::getOne());\n"
"}", nullptr, false, true);
ASSERT_EQUALS("", errout.str());
}
void checkNegativeShift() {