[PATCH] D22507: Clang-tidy - Enum misuse check
Etienne Bergeron via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 25 08:40:43 PDT 2016
etienneb added a comment.
some nits
================
Comment at: docs/clang-tidy/checks/misc-enum-misuse.rst:37
@@ +36,3 @@
+unsigned flag;
+flag = A | H; //OK, disjoint value intervalls in the enum types > probably good use
+flag = B | F; //warning, have common values so they are probably misused
----------------
nit: space after //
here and below.
================
Comment at: docs/clang-tidy/checks/misc-enum-misuse.rst:37
@@ +36,3 @@
+unsigned flag;
+flag = A | H; //OK, disjoint value intervalls in the enum types > probably good use
+flag = B | F; //warning, have common values so they are probably misused
----------------
etienneb wrote:
> nit: space after //
> here and below.
nit: intervalls (typo)
================
Comment at: test/clang-tidy/misc-enum-misuse-weak.cpp:48
@@ +47,3 @@
+ return 1;
+ // CHECK-MESSAGES: :[[@LINE-2]]:17: warning: enum values are from different enum types [misc-enum-misuse]
+ if (I | Y)
----------------
you can remove "[misc-enum-misuse]" from the following line.
Only the first occurrence is enough.
https://reviews.llvm.org/D22507
More information about the cfe-commits
mailing list