Bug 439338 - clazy-qt6-deprecated-api-fixes creates invalid code for QDate::startOfDay
Summary: clazy-qt6-deprecated-api-fixes creates invalid code for QDate::startOfDay
Status: REPORTED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jörg Bornemann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-30 15:15 UTC by Nicolas Fella
Modified: 2021-07-19 10:56 UTC (History)
1 user (show)

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 Nicolas Fella 2021-06-30 15:15:00 UTC
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();