We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12578b2 commit 8e837c4Copy full SHA for 8e837c4
1 file changed
test/testother.cpp
@@ -4678,6 +4678,13 @@ class TestOther : public TestFixture {
4678
" return { [](int* p) { return *p; } };
4679
"}\n");
4680
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());
4688
}
4689
4690
void constArray() {
0 commit comments