From ed7edc6d2a9a5a52036c19453c91a27e1bb2d194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 13 Aug 2019 20:42:25 +0200 Subject: [PATCH] Improve warning message --- lib/checkclass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 197a0f9b6..05d1023a9 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -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); }