mmanek patch 1
I added a condition in the “IsEnumStart” function that checks the token three positions previous to the current one which will help verify that the pattern of the program is correct. Additionally, I added a condition that comes before the return statement of “isClassStructUnionEnumStart” that checks if the enum -> type -> name pattern is detected.
Thanks for contribution.
Please update the title of the PR to reflect what it does. And please add a unit test.
Not sure where it is used, but isEnumStart() doesn't seem to handle e.g. enum E : ::std::uint8_t {. I also dimly remember adding a similar function recently somewhere.
There is isEnumScope() in tokenize.cpp. We should probably consolidate.
Feel free to reopen once comments have been addressed.