Additional heuristic to misc-suspicious-missing-comma checker, based on the (in)equality of the explicitly given array size and the real array size.
Note: in these cases we don't know that the given size is wrong or there is a missing comma.
Original checker revision: http://reviews.llvm.org/D18457
The issue I see by matching the "hasParent" that way is that you are assuming that the matcher is only looking for initialisation-list attached to variable declaration (direct child).
Assume this case:
It is giving you this AST representation:
I believe this can be solved with something like:
That way, you are adding an heuristic to filter some incorrect warnings.
I believe it's possible to match the example above as the size is part of the type.
If I try this example:
I'm getting the following AST:
For the direct case:
It has the following AST-representation:
So, it seems the length could be taken from the type instead of the declaration?!
Or, look at what is the "Array Filler" (I still don't know). This may be an more straight forward way.