[clazy] [Bug 379342] New: clazy-function-args-by-value false positive when ref constructor arg is stored as ref in class
bugzilla_noreply at kde.org
bugzilla_noreply at kde.org
Sat Apr 29 10:42:52 BST 2017
https://bugs.kde.org/show_bug.cgi?id=379342
Bug ID: 379342
Summary: clazy-function-args-by-value false positive when ref
constructor arg is stored as ref in class
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
Assignee: unassigned-bugs at kde.org
Reporter: markus.enzenberger at gmail.com
CC: smartins at kde.org
Target Milestone: ---
The following snippet creates a clazy-function-args-by-value warning even if it
is essential to use a reference since the class stores a copy of the reference.
If the user follows the recommendation by clazy, a bug is intruduced in the
code, which not every compiler will detect and warn about.
struct A
{
const int& m_a;
A(const int& a) : m_a(a) { }
};
I tested this with the current clazy from github (f5e6ccbc). Funnily enough,
clazy does not complain if a non-const reference is used for the member and the
argument.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list