Bug 450019

Summary: function-args-by-ref warns about pass by value even when caller uses std::move
Product: [Developer tools] clazy Reporter: David Faure <faure>
Component: generalAssignee: Unassigned bugs <unassigned-bugs-null>
Status: REPORTED ---    
Severity: normal CC: smartins
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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