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;
|
||||
if (var->isRValueReference())
|
||||
continue;
|
||||
if (var->isPointer())
|
||||
continue;
|
||||
if (var->isConst())
|
||||
continue;
|
||||
if (!var->scope())
|
||||
|
|
|
@ -2305,6 +2305,13 @@ private:
|
|||
"}\n");
|
||||
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"
|
||||
"void g(void);\n"
|
||||
"void h(void);\n"
|
||||
|
|
Loading…
Reference in New Issue