Currently, using the nullPointerConstant AST matcher can lead to assertions in situations where a node to be matched does not have a valid type associated with it, such as a ParenListExpr. This patch addresses that by saying such nodes cannot be a null pointer constant. This addresses PR46353.
While this test in ASTMatchers might continue to make sense, shouldn't there be a test in clang/unittests/AST for this API? isNullPointerConstant seems to be complicated. Does it have a unit test?
It does not have a unit test; we don't usually unit test AST interfaces directly. AST matching tests are the typical way we'd test this because it gives us an almost direct path to the AST interface we want to exercise, but if you can spot an additional place to perform the test more directly, I can look into adding one.