Improve test coverage for postfix increment of raw pointers

This commit is contained in:
Dmitry-Me 2019-12-02 18:12:14 +03:00
parent 78b4485670
commit b14a976c6c
1 changed files with 9 additions and 0 deletions

View File

@ -54,6 +54,7 @@ private:
TEST_CASE(testvolatile);
TEST_CASE(testiterator);
TEST_CASE(test2168);
TEST_CASE(pointerSimplest);
TEST_CASE(pointer); // #2321 - postincrement of pointer is OK
TEST_CASE(testtemplate); // #4686
TEST_CASE(testmember);
@ -314,6 +315,14 @@ private:
ASSERT_EQUALS("", errout.str());
}
void pointerSimplest() {
check("void f(int* p){\n"
" p++;\n"
" std::cout << *p;\n"
"}");
ASSERT_EQUALS("", errout.str());
}
void pointer() {
check("static struct class * ab;\n"
"int * p;\n"