Summary: | clazy-incorrect-emit give warning about missing emit keyword if emit is in a macro | ||
---|---|---|---|
Product: | [Developer tools] clazy | Reporter: | Trần Nam Tuấn (Bill) <tuantran1632001> |
Component: | general | Assignee: | Unassigned bugs <unassigned-bugs-null> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | alexander.lohnau, smartins |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Test project |
Yeah, we have quite a few in KDE Code. Macros are tricky with the syntax tree parsing. But this is indeed quite an annoying issue. |
Created attachment 156019 [details] Test project SUMMARY I write a lot of setters, so I create a macro to avoid retyping a lot of the code: #define UPDATE(NAME) \ if (m_##NAME == newVar) \ return; \ m_##NAME = newVar; \ Q_EMIT NAME##Changed(newVar); Clazy then warn about "missing emit keyword on signal call" if I use the macro. The code does work, however. Tested in QtCreator and Kdevelop. SOFTWARE/OS VERSIONS Linux: Arch Linux KDE Plasma Version: 5.26.5 KDE Frameworks Version: 5.102.0 Qt Version: 5.15.8 Clazy: 1.11