Added regression test for Ticket 7981.
This commit is contained in:
parent
9483ea4198
commit
b6c010c17e
|
@ -6967,6 +6967,18 @@ private:
|
||||||
" return f<X>(s);\n"
|
" return f<X>(s);\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
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() {
|
void checkNegativeShift() {
|
||||||
|
|
Loading…
Reference in New Issue