DeclCXX - Fix getAs<> null-dereference static analyzer warnings. NFCI.getAs<> can return null if the cast is invalid, which can lead to null pointer deferences. Use castAs<> instead which will assert that the cast is valid.