DescriptionAdd a check to the FindBadConstructs.cpp clang plugin for bad enum last values.
One common coding patern is to define an enum as in:
enum Color { RED, GREEN, BLUE, COLOR_LAST=BLUE };
but this is fragile when someone adds a new constant and forgets
to update the COLOR_LAST constant.
This change looks for enums that have a xxx_LAST or xxxLast member,
and warns if there are any higher-valued constants present.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251894
Patch Set 1 #Patch Set 2 : Fix comment. #
Total comments: 1
Patch Set 3 : remove unused flag. #Patch Set 4 : 500s #
Messages
Total messages: 14 (0 generated)
|