Skip to content

Commit 8e837c4

Browse files
Update testother.cpp
1 parent 12578b2 commit 8e837c4

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/testother.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4678,6 +4678,13 @@ class TestOther : public TestFixture {
46784678
" return { [](int* p) { return *p; } };
46794679
"}\n");
46804680
ASSERT_EQUALS("", errout_str());
4681+
4682+
check("void f() {\n"
4683+
" int i = 0;\n"
4684+
" auto x = [&]() { int* p = &i; if (*p) {} };\n"
4685+
" x();\n"
4686+
"}\n");
4687+
ASSERT_EQUALS("[test.cpp:3:24]: (style) Variable 'p' can be declared as pointer to const [constVariablePointer]", errout_str());
46814688
}
46824689

46834690
void constArray() {

0 commit comments

Comments
 (0)