File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4670,21 +4670,21 @@ class TestOther : public TestFixture {
46704670 "struct S { fp_t m_fp; };\n"
46714671 "void g(fp_t);\n"
46724672 "S f(S* s) {\n"
4673- " g_fp = [](int* p) { return *p; };\n"
4674- " s->m_fp = [](int* p) { return *p; };\n"
4673+ " g_fp = [](int* p) { return *p; };\n"
4674+ " s->m_fp = [](int* p) { return *p; };\n"
46754675 " g([](int* p) { return *p; });\n"
46764676 " auto x = [](int* p) { return *p; };\n"
4677- " g(x);\n"
4677+ " g(x);\n"
46784678 " return { [](int* p) { return *p; } };\n"
46794679 "}\n");
46804680 ASSERT_EQUALS("", errout_str());
46814681
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:27]: (style) Variable 'p' can be declared as pointer to const [constVariablePointer]\n", errout_str());
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:27]: (style) Variable 'p' can be declared as pointer to const [constVariablePointer]\n", errout_str());
46884688 }
46894689
46904690 void constArray() {
You can’t perform that action at this time.
0 commit comments