Skip to content

Commit 1eed572

Browse files
committed
add test
1 parent 3181f13 commit 1eed572

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/testnullpointer.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class TestNullPointer : public TestFixture {
141141
TEST_CASE(nullpointer102);
142142
TEST_CASE(nullpointer103);
143143
TEST_CASE(nullpointer104); // #13881
144+
TEST_CASE(nullpointer105); // #13861
144145
TEST_CASE(nullpointer_addressOf); // address of
145146
TEST_CASE(nullpointerSwitch); // #2626
146147
TEST_CASE(nullpointer_cast); // #4692
@@ -2929,6 +2930,17 @@ class TestNullPointer : public TestFixture {
29292930
ASSERT_EQUALS("", errout_str());
29302931
}
29312932

2933+
void nullpointer105() // #13861
2934+
{
2935+
check("struct AB { int a; int b; };\n"
2936+
"namespace ns { typedef AB S[10]; }\n"
2937+
"void foo(void) {\n"
2938+
" ns::S x = {0};\n"
2939+
" x[1].a = 2;\n"
2940+
"}\n");
2941+
ASSERT_EQUALS("", errout_str());
2942+
}
2943+
29322944
void nullpointer_addressOf() { // address of
29332945
check("void f() {\n"
29342946
" struct X *x = 0;\n"

0 commit comments

Comments
 (0)