| Summary: | qt6-qlatin1stringchar-to-u creates duplicates in replacements yaml file | ||
|---|---|---|---|
| Product: | [Developer tools] clazy | Reporter: | Jörg Bornemann <joerg.bornemann> |
| Component: | general | Assignee: | Jörg Bornemann <joerg.bornemann> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | smartins |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
can you reassign to Lucie ? I'm not finding then name in the assign list This was fixed with https://invent.kde.org/sdk/clazy/-/merge_requests/29 |
SUMMARY Consider code like this: ---snip--- #define MY_CONSTANT(type, name, value) \ static const type &name() { \ static const type var{QLatin1String(value)}; \ return var; \ } #define MY_STRING_CONSTANT(name, value) MY_CONSTANT(QString, name, value) MY_STRING_CONSTANT(fooProperty, "foo") MY_STRING_CONSTANT(barProperty, "bar") ---snap--- Applying the qt6-qlatin1stringchar-to-u fixit will create duplicates in the replacements yaml file at the position of QLatin1String within the macro. This leads to errors like this: The new replacement overlaps with an existing replacement. New replacement: ../../../../master/src/lib/corelib/tools/stringconstants.h: 2133:+20:"u"~/"" Existing replacement: ../../../../master/src/lib/corelib/tools/stringconstants.h: 2133:+20:"u"*"" ADDITIONAL INFORMATION Playground project for this was https://code.qt.io/cgit/qbs/qbs.git/ and the file I ran the fixit on was src/lib/corelib/language/language.cpp