cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

mmanek patch 1

Open mmanek opened this issue 1 year ago • 3 comments

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.

mmanek avatar Apr 26 '24 21:04 mmanek

Thanks for contribution.

Please update the title of the PR to reflect what it does. And please add a unit test.

firewave avatar Apr 26 '24 21:04 firewave

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.

chrchr-github avatar Apr 26 '24 21:04 chrchr-github

There is isEnumScope() in tokenize.cpp. We should probably consolidate.

chrchr-github avatar Apr 26 '24 21:04 chrchr-github

Feel free to reopen once comments have been addressed.

chrchr-github avatar May 16 '24 08:05 chrchr-github