gmqcc icon indicating copy to clipboard operation
gmqcc copied to clipboard

enum : flag uses incorrect incrementation with =

Open marrub-- opened this issue 6 years ago • 0 comments

When compiling an enumeration with the flag attribute, using the = syntax to set the current constant will cause the next variant to be offset by one.

Code to reproduce:

enum : flag {
	FL_FLY,
	FL_SWIM,
	FL_CLIENT = 8,
	FL_INWATER, // will be 18 ((8+1)*2), not 16 (8*2)
};

The line that breaks this: https://github.com/graphitemaster/gmqcc/blob/master/parser.cpp#L3717

marrub-- avatar Sep 16 '19 21:09 marrub--