Discussion:
[clazy] [Bug 391812] New: False positive for check "function-args-by-value"
(too old to reply)
Roman
2018-03-13 14:11:22 UTC
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=391812

Bug ID: 391812
Summary: False positive for check "function-args-by-value"
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
Assignee: unassigned-***@kde.org
Reporter: ***@gmail.com
CC: ***@kde.org
Target Milestone: ---

I am not sure if this is worth to fix but anyway.

For virtual method

virtual void updateState(const QPaintEngineState &state) = 0;

i declare implementation like this

virtual void updateState(const QPaintEngineState &state) Q_DECL_OVERRIDE;

Because class QPaintEngineState is trivial i get warning
"function-args-by-value". And i cannot fix declaration because this breaks
overload. And also i cannot fix class QPaintEngine because it is part of Qt
headers.

Of course i can suppress the warning, but still, if clazy would be little bit
smarter and ignore such cases from system headers. Don't know how good the idea
is, maybe not really. But it is natural to want reduce any noise if nothing you
can do about it.
--
You are receiving this mail because:
You are watching all bug changes.
Sergio Martins
2018-03-13 14:47:11 UTC
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=391812

Sergio Martins <***@kde.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned-***@kde.org |***@kde.org
--
You are receiving this mail because:
You are watching all bug changes.
Sergio Martins
2018-03-13 14:47:20 UTC
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=391812

Sergio Martins <***@kde.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |CONFIRMED
Ever confirmed|0 |1
--
You are receiving this mail because:
You are watching all bug changes.
Sergio Martins
2018-03-17 17:37:10 UTC
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=391812

Sergio Martins <***@kde.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Latest Commit| |https://commits.kde.org/cla
| |zy/dba14f317183428e64a3d4e6
| |c0559faacafdf6b0
Status|CONFIRMED |RESOLVED

--- Comment #1 from Sergio Martins <***@kde.org> ---
Git commit dba14f317183428e64a3d4e6c0559faacafdf6b0 by Sergio Martins.
Committed on 17/03/2018 at 17:14.
Pushed by smartins into branch 'master'.

function-args-by-*: don't warn for overridden methods

As the user often can't change its signature.
If it's a base method then it will warn.

M +8 -0 src/Utils.h
M +5 -0 src/checks/level2/function-args-by-ref.cpp
M +13 -9 src/checks/level2/function-args-by-value.cpp
M +17 -0 tests/function-args-by-ref/main.cpp
M +5 -0 tests/function-args-by-ref/main.cpp.expected
M +17 -0 tests/function-args-by-value/main.cpp
M +5 -0 tests/function-args-by-value/main.cpp.expected
M +17 -0 tests/function-args-by-value/main.cpp_fixed.cpp.expected

https://commits.kde.org/clazy/dba14f317183428e64a3d4e6c0559faacafdf6b0
--
You are receiving this mail because:
You are watching all bug changes.
Loading...