File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -730,6 +730,19 @@ class TestIncompleteStatement : public TestFixture {
730730 " }\n " );
731731 ASSERT_EQUALS (" [test.cpp:3:5]: (warning) Redundant code: Found unused lambda. [constStatement]\n " ,
732732 errout_str ());
733+
734+ check (" int main() {\n " // #13177
735+ " sizeof(int);\n "
736+ " alignof(long double*);\n "
737+ " noexcept(int());\n "
738+ " typeid(int);\n "
739+ " return(0);\n "
740+ " }\n " );
741+ ASSERT_EQUALS (" [test.cpp:2:11]: (warning) Redundant code: Found unused 'sizeof' expression. [constStatement]\n "
742+ " [test.cpp:3:12]: (warning) Redundant code: Found unused 'alignof' expression. [constStatement]\n "
743+ " [test.cpp:4:13]: (warning) Redundant code: Found unused 'noexcept' expression. [constStatement]\n "
744+ " [test.cpp:5:11]: (warning) Redundant code: Found unused 'typeid' expression. [constStatement]\n " ,
745+ errout_str ());
733746 }
734747
735748 void vardecl () {
You can’t perform that action at this time.
0 commit comments