Bug 431389

Summary: qstring-allocations does not detect constructing a QStringList with braced initialization
Product: [Developer tools] clazy Reporter: Christian Schärf <c.schaerf>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: REPORTED ---    
Severity: normal CC: smartins
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: AST excerpt from the example code

Description Christian Schärf 2021-01-10 13:28:11 UTC
Consider the following code:

#include <QStringList>

void f() {
    QStringList list{"test"};
}

Clazy does not emit a warning from the qstring-allocations check, despite a QString being constructed from a const char*. The the relevant AST is attached.
Comment 1 Christian Schärf 2021-01-10 13:28:51 UTC
Created attachment 134708 [details]
AST excerpt from the example code