Fix issue 10002: False positive: constParameter with reference to pointer (#2918)
This commit is contained in:
parent
bf00d521d7
commit
4a8a78a925
|
@ -1361,6 +1361,8 @@ void CheckOther::checkConstVariable()
|
||||||
continue;
|
continue;
|
||||||
if (var->isRValueReference())
|
if (var->isRValueReference())
|
||||||
continue;
|
continue;
|
||||||
|
if (var->isPointer())
|
||||||
|
continue;
|
||||||
if (var->isConst())
|
if (var->isConst())
|
||||||
continue;
|
continue;
|
||||||
if (!var->scope())
|
if (!var->scope())
|
||||||
|
|
|
@ -2305,6 +2305,13 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// #10002
|
||||||
|
check("using A = int*;\n"
|
||||||
|
"void f(const A& x) {\n"
|
||||||
|
" ++(*x);\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
check("void e();\n"
|
check("void e();\n"
|
||||||
"void g(void);\n"
|
"void g(void);\n"
|
||||||
"void h(void);\n"
|
"void h(void);\n"
|
||||||
|
|
Loading…
Reference in New Issue