Bug 408871

Summary: False positive with -Wclazy-qstring-left
Product: [Developer tools] clazy Reporter: Andre Woebbeking <woebbeking>
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 Andre Woebbeking 2019-06-18 11:42:34 UTC
Hi,

the following code

QString text;
QStringList list;
list.append(text.left(1));

gives me "warning: Use QString::at(0) instead of QString::left(1) to avoid temporary allocations". But append() needs a QString so there is no way to avoid the temporary.

I'm using clazy 1.5.

Cheers,
André