Skip to content

Commit 887353d

Browse files
committed
Add tests for other tickets
1 parent 7649f99 commit 887353d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/testunusedvar.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6682,9 +6682,33 @@ class TestUnusedVar : public TestFixture {
66826682
"}");
66836683
ASSERT_EQUALS("", errout_str());
66846684

6685+
// #14643
66856686
functionVariableUsage("class S { S(int); };\n"
66866687
"void f() { S s = 0; }\n");
66876688
ASSERT_EQUALS("", errout_str());
6689+
6690+
// #10965
6691+
functionVariableUsage("class A {\n"
6692+
"public:\n"
6693+
" A();\n"
6694+
"};\n"
6695+
"extern A cb();\n"
6696+
"void f() { const A c = cb(); }\n");
6697+
ASSERT_EQUALS("", errout_str());
6698+
6699+
// #11704
6700+
functionVariableUsage("class S {\n"
6701+
"public:\n"
6702+
" S();\n"
6703+
"};\n"
6704+
"class C {\n"
6705+
" S &s();\n"
6706+
" void f() {\n"
6707+
" const S s1 = s(); // warning\n"
6708+
" const S s2; // no warning\n"
6709+
" }\n"
6710+
"};\n");
6711+
ASSERT_EQUALS("", errout_str());
66886712
}
66896713

66906714
void localVarSmartPtr() {

0 commit comments

Comments
 (0)