| Summary: | Incorrect warning [-Wclazy-incorrect-emit] | ||
|---|---|---|---|
| Product: | [Developer tools] clazy | Reporter: | Richard <richard.oehlinger> |
| Component: | general | Assignee: | Unassigned bugs <unassigned-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | major | CC: | smartins |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
SUMMARY Following code produces an incorrect emit warning: Emitting inside constructor probably has no effect [-Wclazy-incorrect-emit] When i change the connect to a pointer to method, the error doesn't occour. *** class MyClass : public QObject { Q_OBJECT public: void func(); signals: void mySignal(); }; void MyClass::func() { QNetworkReply* logout_reply = nullptr; QObject::connect(logout_reply, &QNetworkReply::finished, [] { }); emit mySignal(); } **** By the way IncorrectEmit::hasEmitKeyboard looks like a mis-spelling.