This is a fairly basic form of aliasing that as we've noticed in D96215 hasn't been covered yet.
At the same time this patch causes unfortunate false negatives on the regression tests for bugprone-redundant-branch-condition that has a builtin incomplete but slightly more robust solution to the same problem. These false negatives are something that we didn't really have a right to warn at until we've had a more flow-sensitive alias analysis. Like, they're valid warnings but we can't emit them with the analysis that we have without consciously introducing false positives as well. So I think it's a judgement call. I'm definitely in favor of landing it despite the false negatives it introduces but this may go against clang-tidy's philosophy on this issue so I'm open to not landing it.
The patch uses AnyCall in order to cover 5 different AST node kinds for call-like expressions none of which inherit from CallExpr (apart from CallExpr itself).
clang-tidy: warning: #includes are not sorted properly [llvm-include-order]
not useful
clang-format: please reformat the code