This is mostly factored out of D48958.
As of D49838, ImplicitCastExpr can tell whether it is a part of ExplicitCastExpr group.
But given just the CastExpr, one still has to check that it is not ExplicitCastExpr itself,
before using ImplicitCastExpr::getIsPartOfExplicitCast().
Thus, it makes sense to factor out it into a helper function in CastExpr baseclass.
This indeed does not have tests. Would be happy to add those, if needed and told how to write those.
These two sentences are both sentence fragments and should likely be joined.
A suggested alternative?
"An explicit cast corresponds to a cast written in the source code, while an implicit cast is materialized for the purposes of automatic conversions.