parent
5761e55a67
commit
6aa3478243
|
@ -140,6 +140,7 @@ private:
|
|||
TEST_CASE(nullpointer99); // #10602
|
||||
TEST_CASE(nullpointer100); // #11636
|
||||
TEST_CASE(nullpointer101); // #11382
|
||||
TEST_CASE(nullpointer102);
|
||||
TEST_CASE(nullpointer_addressOf); // address of
|
||||
TEST_CASE(nullpointerSwitch); // #2626
|
||||
TEST_CASE(nullpointer_cast); // #4692
|
||||
|
@ -2843,6 +2844,20 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void nullpointer102()
|
||||
{
|
||||
check("struct S { std::string str; };\n" // #11534
|
||||
"struct T { S s; };\n"
|
||||
"struct U { T t[1]; };\n"
|
||||
"void f(const T& t, const U& u, std::string& str) {\n"
|
||||
" if (str.empty())\n"
|
||||
" str = t.s.str;\n"
|
||||
" else\n"
|
||||
" str = u.t[0].s.str;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void nullpointer_addressOf() { // address of
|
||||
check("void f() {\n"
|
||||
" struct X *x = 0;\n"
|
||||
|
|
Loading…
Reference in New Issue