| Summary: | clazy-qt6-deprecated-api-fixes creates invalid code for QDate::startOfDay | ||
|---|---|---|---|
| Product: | [Developer tools] clazy | Reporter: | Nicolas Fella <nicolas.fella> |
| Component: | general | Assignee: | Jörg Bornemann <joerg.bornemann> |
| Status: | RESOLVED UNMAINTAINED | ||
| Severity: | normal | CC: | alexander.lohnau, smartins |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
The Qt6 porting checks are deprecated with clazy 1.16 |
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();