Skip to content

Commit cf7ef2e

Browse files
Dmitry-Medanmar
authored andcommitted
Valid code for incrementing raw pointer (cppcheck-opensource#2418)
1 parent 36977be commit cf7ef2e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/testpostfixoperator.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,10 @@ class TestPostfixOperator : public TestFixture {
326326
void pointer() {
327327
check("static struct class * ab;\n"
328328
"int * p;\n"
329-
"p++;\n");
329+
"\n"
330+
"void f() {\n"
331+
" p++;\n"
332+
"}\n");
330333
ASSERT_EQUALS("", errout.str());
331334
}
332335

0 commit comments

Comments
 (0)