[PATCH] D74735: [analyzer] Add support for CXXInheritedCtorInitExpr.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 23 16:28:26 PST 2020


NoQ marked an inline comment as done.
NoQ added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:494
   if (State != Pred->getState()) {
+    assert(CE && "Inherited constructors do not have construction contexts!");
     static SimpleProgramPointTag T("ExprEngine",
----------------
Charusso wrote:
> baloghadamsoftware wrote:
> > martong wrote:
> > > `CIE` ?
> > No. `CE`. Since inherited constructors do not have construction contexts, `State` is the same for `CIE` as the previous `State`. Thus if they are different, we are facing a `CE`.
> This assertion has been removed intentionally?
Yup. I think this isn't a valuable assertion because (1) the invariant it documents ("inherited constructors don't require additional tracking in the program state so far") is accidental rather than intentional (we may add other kinds of tracking later) and (2) the code behaves reasonably well even if the assertion fails (given that i replaced `CE` with `E` in the `generateNode` invocation).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74735/new/

https://reviews.llvm.org/D74735





More information about the cfe-commits mailing list