Cppcheck is more lenient than compilers so it is possible that invalid code can still be successfully analyzed. The same is actually true for clang-tidy which might also report findings even if you are getting compiler errors.
If the code cannot be compiled to begin with I see no issue here.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This code does not compile: "error: size of array ‘condition_failed’ is negative"
but cppcheck says:
error: Array 'condition_failed[-1]' accessed at index 0, which is out of bounds. [arrayIndexOutOfBounds]
I think there's something amiss in the analysis, no ?
Cppcheck is more lenient than compilers so it is possible that invalid code can still be successfully analyzed. The same is actually true for clang-tidy which might also report findings even if you are getting compiler errors.
If the code cannot be compiled to begin with I see no issue here.