[clazy] [Bug 439338] New: clazy-qt6-deprecated-api-fixes creates invalid code for QDate::startOfDay

Nicolas Fella bugzilla_noreply at kde.org
Wed Jun 30 16:15:00 BST 2021


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

            Bug ID: 439338
           Summary: clazy-qt6-deprecated-api-fixes creates invalid code
                    for QDate::startOfDay
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: nicolas.fella at gmx.de
                CC: smartins at kde.org
  Target Milestone: ---

Consider the following code

#include <QDateTime>

struct Foo {

    QDate someDate() {
        return {};
    }
};

int main(int argc, char *argv[])
{
    Foo *foo = new Foo;
    QDateTime{foo->someDate()};
}


clazy warns that the QDateTime ctor is deprecated and suggests to use
QDate::startOfDay()

The fixit generates:

foo->startOfDay();

while it should be

foo->someDate().startOfDay();

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


More information about the Unassigned-bugs mailing list