Skip to content

Commit 364715d

Browse files
Update testclass.cpp
1 parent c358ae1 commit 364715d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/testclass.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6821,6 +6821,13 @@ class TestClass : public TestFixture {
68216821
"};\n");
68226822
ASSERT_EQUALS("[test.cpp:3:10]: (style, inconclusive) Technically the member function 'D::f' can be const. [functionConst]\n",
68236823
errout_str());
6824+
6825+
checkConst("struct S {\n" // #12162
6826+
" bool has(int i) { return m.find(i) != m.end(); }\n");
6827+
" std::map<int, int> m;\n"
6828+
"};\n");
6829+
ASSERT_EQUALS("[test.cpp.2:10]: (style, inconclusive) Technically the member function 'S::has' can be const. [functionConst]\n",
6830+
errout_str());
68246831
}
68256832

68266833
void const98() { // #13642

0 commit comments

Comments
 (0)