Skip to content

Commit 4cba90d

Browse files
Update testsizeof.cpp
1 parent 2538dcd commit 4cba90d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/testsizeof.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ class TestSizeof : public TestFixture {
334334
"}");
335335
ASSERT_EQUALS("", errout_str());
336336

337+
check("int f(std::array<int, 2> a) {\n" // #14860
338+
" return sizeof(a);\n"
339+
"}\n"
340+
"int g(std::string a[2]) {\n"
341+
" return sizeof(a);\n"
342+
"}\n");
343+
ASSERT_EQUALS("[test.cpp:5:12]: (warning) Using 'sizeof' on array given as function argument returns size of a pointer. [sizeofwithsilentarraypointer]\n",
344+
errout_str());
337345
}
338346

339347
void sizeofForNumericParameter() {

0 commit comments

Comments
 (0)