[PATCH] D39711: [analyzer] ObjCGenerics: Don't warn on cast conversions involving explicit cast

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 6 18:56:02 PST 2017

george.karpenkov added inline comments.

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?

Comment at: test/Analysis/generics.m:7143
 // CHECK-NEXT:   <dict>
-// CHECK-NEXT:    <key>line</key><integer>375</integer>
+// CHECK-NEXT:    <key>line</key><integer>380</integer>
 // CHECK-NEXT:    <key>col</key><integer>70</integer>
could we remove dict with locations from the test output entirely, and just check that we get those warnings, in order?


More information about the cfe-commits mailing list