================
@@ -269,6 +269,12 @@ void AvoidCStyleCastsCheck::check(const
MatchFinder::MatchResult &Result) {
return;
}
break;
+ case CK_BaseToDerived:
+ if (!needsConstCast(SourceType, DestType)) {
+ ReplaceWithNamedCast("static_cast");
+ return;
+ }
+ break;
----------------
HerrCai0907 wrote:
Is it a best practice to use `static_cast` for base to derived always?
I think under RTTI, we should use `dynamic_cast` and under non-RTTI,
`static_cast` could be used also.
https://github.com/llvm/llvm-project/pull/165411
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits