Bug 431389 - qstring-allocations does not detect constructing a QStringList with braced initialization
Summary: qstring-allocations does not detect constructing a QStringList with braced in...
Status: REPORTED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-10 13:28 UTC by Christian Schärf
Modified: 2021-01-10 13:28 UTC (History)
1 user (show)

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


Attachments
AST excerpt from the example code (1.64 KB, text/plain)
2021-01-10 13:28 UTC, Christian Schärf
Details

Note You need to log in before you can comment on or make changes to this bug.
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