Skip to content

Commit b4eae9c

Browse files
Update testincompletestatement.cpp
1 parent d3d34ec commit b4eae9c

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/testincompletestatement.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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() {

0 commit comments

Comments
 (0)