----------------------------------- #include <QObject> //class Foo namespace Foo { // Q_OBJECT enum Bar { }; Q_ENUM ( Bar ) } //; ----------------------------------- Within this code, clazy warns about Q_ENUM usage but Q_ENUMS does not work here since there's no parent class which is derived from QObject and so no QMetaObject ... Did not find a simple solution for this problem so I had to write a bug report :) Reproducible: Always Steps to Reproduce: see details
Ok, the question is - why someone would add Q_ENUM for a enum defined in a namespace. I currently can't see a reason for it but moc does not complain either ... :)
Yeah, there's no reason. clazy could give a different warning for this case but the fix isn't trivial since the macro processor isn't connected to the AST, so I'll just close this