[clazy] [Bug 403088] New: function-args-by-value should ignore std::atomic
Matthew Woehlke
bugzilla_noreply at kde.org
Fri Jan 11 04:00:03 GMT 2019
https://bugs.kde.org/show_bug.cgi?id=403088
Bug ID: 403088
Summary: function-args-by-value should ignore std::atomic
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: unassigned-bugs at kde.org
Reporter: mwoehlke.floss at gmail.com
CC: smartins at kde.org
Target Milestone: ---
SUMMARY
Although std::atomic is correctly considered a "small and trivially-copyable
type", passing one by value makes no sense. The only plausible use case for
passing a std::atomic is passing by reference. Accordingly, it is always a
false positive for clazy to warn about passing std::atomic by reference.
STEPS TO REPRODUCE
1. Run clazy on a function that takes a std::atomic by const reference.
OBSERVED RESULT
Clazy complains that the parameter should be passed by value.
EXPECTED RESULT
Clazy should not complain. (Possibly it should complain about std::atomic that
is *not* passed by reference.)
SOFTWARE/OS VERSIONS
clazy: master (75c097b118931e2d8f3a66cc12bf7045ee548e81)
clang: clang-6.0.1-2.fc28
llvm: llvm-6.0.1-8.fc28
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list