[PATCH] Add a new flag enum attribute to improve warnings

Sean Hunt scshunt at csclub.uwaterloo.ca
Fri Oct 17 17:34:05 PDT 2014


I recently was annoyed by clang when it was warning about assignment
to an enum which I was using as a flag type, because val1 | val2 is
not a valid enumerator constant. I like -Wassign-enum and -Wswitch in
principle, and so I've introduced an attribute to distinguish them in
the compiler and adjusted a few warnings accordingly.

http://reviews.llvm.org/D5853

I would appreciate review, since I've been away long enough that even
if I still have commit access, I'm not going to just up and use it.

Sean



More information about the cfe-commits mailing list