Bug 450019 - function-args-by-ref warns about pass by value even when caller uses std::move
Summary: function-args-by-ref warns about pass by value even when caller uses std::move
Status: REPORTED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-11 15:56 UTC by David Faure
Modified: 2022-02-11 15:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Faure 2022-02-11 15:56:24 UTC
SUMMARY

This testcase:

int f(QVector<int> vec)
{
    return vec.size();
}
void m()
{
    QVector<int> myvec = {1, 2, 3};
    qDebug() << f(std::move(myvec));
}

leads to:

OBSERVED RESULT

Warning: Missing reference on non-trivial type (QVector<int>) [clazy-function-args-by-ref]

EXPECTED RESULT

No warning

SOFTWARE/OS VERSIONS

clazy version 1.10
LLVM (http://llvm.org/):
  LLVM version 12.0.1