[clazy] [Bug 430138] New: qt6-qlatin1stringchar-to-u creates duplicates in replacements yaml file

Jörg Bornemann bugzilla_noreply at kde.org
Tue Dec 8 07:12:25 GMT 2020


https://bugs.kde.org/show_bug.cgi?id=430138

            Bug ID: 430138
           Summary: qt6-qlatin1stringchar-to-u creates duplicates in
                    replacements yaml file
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: joerg.bornemann at qt.io
                CC: smartins at kde.org
  Target Milestone: ---

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

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list