Skip to content

Commit ffffc38

Browse files
Update testfunctions.cpp
1 parent 1a0d946 commit ffffc38

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/testfunctions.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,13 @@ class TestFunctions : public TestFixture {
761761
"}\n");
762762
ASSERT_EQUALS("", errout_str());
763763

764+
check("char* f() {\n" // #14715
765+
" char a[3] = { 'a', 'b', 'c' };\n"
766+
" *a = 0;\n"
767+
" return strdup(a);\n"
768+
"}\n");
769+
ASSERT_EQUALS("", errout_str());
770+
764771
check("size_t f() { wchar_t x = L'x'; return wcslen(&x); }");
765772
ASSERT_EQUALS("[test.cpp:1:46]: (error) Invalid wcslen() argument nr 1. A nul-terminated string is required. [invalidFunctionArgStr]\n", errout_str());
766773

0 commit comments

Comments
 (0)