[PATCH] D67079: [analyzer] CastValueChecker: Model inheritance
Csaba Dabis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 30 13:13:14 PDT 2019
Charusso marked 2 inline comments as done.
Charusso added a comment.
In D67079#1688648 <https://reviews.llvm.org/D67079#1688648>, @NoQ wrote:
> In D67079#1687577 <https://reviews.llvm.org/D67079#1687577>, @Charusso wrote:
>
> > - `CastVisitor` is the new facility which decides whether the assumptions are appropriate.
> > - The math is still WIP.
>
>
> You need the math to decide whether delaying the decision to a visitor is the right approach.
Yes, Soon(tm).
================
Comment at: clang/test/Analysis/cast-value-hierarchy-fp-suppression.cpp:25-27
+ if (isa<B>(a))
+ if (isa<C>(a))
+ clang_analyzer_warnIfReached(); // no-warning
----------------
NoQ wrote:
> Why is `(isa<B>(a) && isa<C>(a))` deemed possible in the first test but not in the second test? o_o
In `test_downcast()` we assume that `a` is a record type of `D` where `D` is a `B` and `D` is a `C`. However in `test_downcast_infeasible()` if `a` is not a record type of `D` is cannot be both `B` and `C` at the same time. That is the purpose of `CastVisitor`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67079/new/
https://reviews.llvm.org/D67079
More information about the cfe-commits
mailing list