File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff 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 () {
You can’t perform that action at this time.
0 commit comments