[PATCH] D39711: [analyzer] ObjCGenerics: Don't warn on cast conversions involving explicit cast
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 7 04:58:24 PST 2017
xazax.hun added a comment.
In https://reviews.llvm.org/D39711#917433, @dcoughlin wrote:
> @xazax.hun Would you be willing to take a look?
Sure, I basically agree with George.
Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:587
if (TrackedType &&
+ !isa<ExplicitCastExpr>(CE) &&
!ASTCtxt.canAssignObjCInterfaces(DestObjectPtrType, *TrackedType) &&
> Should it check that we are actually casting to the right type? Also it's a bit strange that isa<> check on line 569 did not catch this case, maybe that if- branch should be generalized instead?
I agree, line 569 supposed to handle this case and also update the state accordingly.
More information about the cfe-commits