Bug 353807 - qstring-uneeded-heap-allocations: Fix cases where MSVC doesn't support QStringLiteral
Summary: qstring-uneeded-heap-allocations: Fix cases where MSVC doesn't support QStrin...
Status: RESOLVED FIXED
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: 2015-10-11 23:03 UTC by Sergio Martins
Modified: 2015-11-06 20:05 UTC (History)
0 users

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 Sergio Martins 2015-10-11 23:03:27 UTC
We need some flags to force clazy to be more conservative, see QStringLiteral documents for where it isn't supported in MSVC2010 and 2012
Comment 1 Sergio Martins 2015-11-06 20:05:26 UTC
Git commit 93ca863d1e6705192f3884bd61f21e70cf0d8223 by Sergio Martins.
Committed on 06/11/2015 at 20:04.
Pushed by smartins into branch 'master'.

qstring-uneeded-heap-allocations: Add msvc-compat option

If set then QStringLiteral won't be used when inside initializer lists
Such as static QStringList list = {"foo"}, because it crashes the compiler

M  +4    -0    checks/README-qstring-uneeded-heap-allocations
M  +14   -0    checks/qstringuneededheapallocations.cpp
M  +4    -0    checks/qstringuneededheapallocations.h
M  +4    -1    tests/qstring-uneeded-heap-allocations/fixed_main.expected
M  +4    -0    tests/qstring-uneeded-heap-allocations/main.cpp
M  +2    -0    tests/qstring-uneeded-heap-allocations/test.expected

http://commits.kde.org/clazy/93ca863d1e6705192f3884bd61f21e70cf0d8223