File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -4332,6 +4332,14 @@ class TestConstructors : public TestFixture {
43324332 " template<class T1, class T2>\n "
43334333 " A<B<T1, T2>>::A() : m_value(false) {}" );
43344334 ASSERT_EQUALS (" " , errout.str ());
4335+
4336+ check (" template <typename T> struct S;\n " // #11177
4337+ " template <> struct S<void> final {\n "
4338+ " explicit S(int& i);\n "
4339+ " int& m;\n "
4340+ " };\n "
4341+ " S<void>::S(int& i) : m(i) {}\n " );
4342+ ASSERT_EQUALS (" " , errout.str ());
43354343 }
43364344
43374345 void unknownTemplateType () {
Original file line number Diff line number Diff line change @@ -696,6 +696,12 @@ class TestIncompleteStatement : public TestFixture {
696696 ASSERT_EQUALS (" [test.cpp:2]: (warning) Redundant code: Found a statement that begins with NULL constant.\n "
697697 " [test.cpp:3]: (warning) Redundant code: Found a statement that begins with NULL constant.\n " ,
698698 errout.str ());
699+
700+ check (" struct S { int i; };\n " // #6504
701+ " void f(S* s) {\n "
702+ " (*s).i;\n "
703+ " }\n " );
704+ ASSERT_EQUALS (" [test.cpp:3]: (warning) Redundant code: Found unused member access.\n " , errout.str ());
699705 }
700706
701707 void vardecl () {
You can’t perform that action at this time.
0 commit comments