You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testother.cpp
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4749,6 +4749,31 @@ class TestOther : public TestFixture {
4749
4749
" return [](int* p) { return *p; }(&i);\n"
4750
4750
"}\n");
4751
4751
ASSERT_EQUALS("[test.cpp:3:20]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n", errout_str());
4752
+
4753
+
check("class A {\n"
4754
+
"public:\n"
4755
+
" void func01(QPoint* pt1) {\n"
4756
+
" if (nullptr == pt1) {}\n"
4757
+
" }\n"
4758
+
"};\n");
4759
+
ASSERT_EQUALS("[test.cpp:3:25]: (style) Parameter 'pt1' can be declared as pointer to const [constParameterPointer]\n",
4760
+
errout_str());
4761
+
4762
+
check("class A : public QObject {\n"
4763
+
"public:\n"
4764
+
" void func01(QPoint* pt2) {\n"
4765
+
" if (nullptr == pt2) {}\n"
4766
+
" }\n"
4767
+
"};\n");
4768
+
ASSERT_EQUALS("[test.cpp:3:25]: (style) Either there is missing override/final keyword, or the Parameter 'pt2' can be pointer to const [constParameterPointer]\n",
0 commit comments