Skip to content

Commit 306167b

Browse files
Update testclass.cpp
1 parent 185c0c1 commit 306167b

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/testclass.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7741,6 +7741,19 @@ class TestClass : public TestFixture {
77417741
" }\n"
77427742
"};");
77437743
ASSERT_EQUALS("[test.cpp:8:10]: (style, inconclusive) Technically the member function 'Fred::f2' can be const. [functionConst]\n", errout_str());
7744+
7745+
checkConst("struct T {\n" // #14390
7746+
" std::vector<int*> v;\n"
7747+
" void f() {\n"
7748+
" for (const auto& p : v)\n"
7749+
" *p = 0;\n"
7750+
" }\n"
7751+
" void g() {\n"
7752+
" for (auto* p : v)\n"
7753+
" *p = 0;\n"
7754+
" }\n"
7755+
"};\n");
7756+
ASSERT_EQUALS("", errout_str());
77447757
}
77457758

77467759
void const_shared_ptr() { // #8674

0 commit comments

Comments
 (0)