Add constParameter and constParameterCallback in --errorlist output
This commit is contained in:
parent
d5759d4708
commit
d5ef25e477
|
@ -1593,8 +1593,15 @@ void CheckOther::checkConstPointer()
|
||||||
}
|
}
|
||||||
void CheckOther::constVariableError(const Variable *var, const Function *function)
|
void CheckOther::constVariableError(const Variable *var, const Function *function)
|
||||||
{
|
{
|
||||||
const std::string vartype((var && var->isArgument()) ? "Parameter" : "Variable");
|
if (!var) {
|
||||||
const std::string varname(var ? var->name() : std::string("x"));
|
reportError(nullptr, Severity::style, "constParameter", "Parameter 'x' can be declared with const");
|
||||||
|
reportError(nullptr, Severity::style, "constVariable", "Variable 'x' can be declared with const");
|
||||||
|
reportError(nullptr, Severity::style, "constParameterCallback", "Parameter 'x' can be declared with const, however it seems that 'f' is a callback function.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string vartype(var->isArgument() ? "Parameter" : "Variable");
|
||||||
|
const std::string varname(var->name());
|
||||||
|
|
||||||
ErrorPath errorPath;
|
ErrorPath errorPath;
|
||||||
std::string id = "const" + vartype;
|
std::string id = "const" + vartype;
|
||||||
|
|
Loading…
Reference in New Issue