Skip to content

Commit b14a976

Browse files
committed
Improve test coverage for postfix increment of raw pointers
1 parent 78b4485 commit b14a976

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/testpostfixoperator.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class TestPostfixOperator : public TestFixture {
5454
TEST_CASE(testvolatile);
5555
TEST_CASE(testiterator);
5656
TEST_CASE(test2168);
57+
TEST_CASE(pointerSimplest);
5758
TEST_CASE(pointer); // #2321 - postincrement of pointer is OK
5859
TEST_CASE(testtemplate); // #4686
5960
TEST_CASE(testmember);
@@ -314,6 +315,14 @@ class TestPostfixOperator : public TestFixture {
314315
ASSERT_EQUALS("", errout.str());
315316
}
316317

318+
void pointerSimplest() {
319+
check("void f(int* p){\n"
320+
" p++;\n"
321+
" std::cout << *p;\n"
322+
"}");
323+
ASSERT_EQUALS("", errout.str());
324+
}
325+
317326
void pointer() {
318327
check("static struct class * ab;\n"
319328
"int * p;\n"

0 commit comments

Comments
 (0)