https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16186
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to trashyankes from comment #7) > Should be way to disable/enable this warning per `enum`? > Like: > > ``` > enum [[gnu::enum_unique]] X > { > I = 1, > J = 2, > }; > > enum [[gnu::enum_not_unique]] Y > { > K = 1, > L = 1, > }; > > ``` No, it should warn solely if enumerator gets implicitly assigned value of some other enumerator. After all, the clang wording also mentions that: element 'D' has been implicitly assigned 5 which another element has been assigned [-Wduplicate-enum] If there is = value for it, we should never warn, that is most likely completely intentional. Of course, we should use better wording, because we should talk about enumerators, not elements...