Summary: | False positive check "qstring-allocations" for function translate | ||
---|---|---|---|
Product: | [Developer tools] clazy | Reporter: | Roman <dismine> |
Component: | general | Assignee: | Unassigned bugs mailing-list <unassigned-bugs> |
Status: | RESOLVED NOT A BUG | ||
Severity: | normal | CC: | smartins |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | compilable-testcase |
Description
Roman
2018-03-13 15:27:19 UTC
Can you show a compilable-testcase. Must be minimal, as I'll shove the code directly into clazy's unit-tests thanks Created attachment 111374 [details]
compilable-testcase
Minimal project that shows false positive warning. Uncomment strings to test canonical way.
tr() doesn't take QString as argument, so there's no allocation You can either use const char* in your translate function, or: translate(QStringLiteral("context"), QStringLiteral("string"), QStringLiteral("disambiguation")); I don't see a way clazy could distinguish this case Yes, you are right. This ticket should be closed. |