Improve warning message

This commit is contained in:
Daniel Marjamäki 2019-08-13 20:42:25 +02:00
parent 41f8c1b281
commit ed7edc6d2a
1 changed files with 1 additions and 1 deletions

View File

@ -2692,6 +2692,6 @@ void CheckClass::safeClassRefMemberError(const Token *tok, const std::string &va
reportError(tok, Severity::warning, "safeClassRefMember",
"$symbol:" + varname + "\n"
"Unsafe class: The const reference member '$symbol' is initialized by a const reference constructor argument. You need to be careful about lifetime issues.\n"
"Safe class checking: The const reference member '$symbol' is initialized by a const reference constructor argument. You need to be careful about lifetime issues. If you pass a local variable or temporary value in this constructor argument, be extra careful. If the argument is always some global object that is never destroyed then this is safe usage. However it would be defensive to make the member '$symbol' a non-reference variable.",
"Safe class checking: The const reference member '$symbol' is initialized by a const reference constructor argument. You need to be careful about lifetime issues. If you pass a local variable or temporary value in this constructor argument, be extra careful. If the argument is always some global object that is never destroyed then this is safe usage. However it would be defensive to make the member '$symbol' a non-reference variable or a smart pointer.",
CWE(0), false);
}