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

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 23 15:26:05 PST 2020


Charusso accepted this revision.
Charusso added a comment.
This revision is now accepted and ready to land.

I think on a long term our knowledge increases so we could generalize upon what we have learnt. For now as long as it is working and have tests, it is cool.



================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:872
+///
+/// Example: \c class T : public S { using S::S; }; T(1);
+class CXXInheritedConstructorCall : public AnyFunctionCall {
----------------
NoQ wrote:
> martong wrote:
> > Perhaps the example could provide the definition of  the class `S` too.
> Dunno, it's kinda obvious that it has some constructor from an integer, and that's really the only thing that we need to know about it. Also what's the proper way to make a line break in `\c`? Because i always forget how to build with doxygen :)
The simplest way is the Markdown support with triple ``` above and below the code-snippet: http://www.doxygen.nl/manual/markdown.html
The other more commonly used way is `\code`: http://www.doxygen.nl/manual/commands.html#cmdcode


================
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",
----------------
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?


================
Comment at: clang/lib/StaticAnalyzer/Core/SymbolManager.cpp:545
 
+    // Anonymous parameters of an inheriting constructor are live for the entire
+    // duration of the constructor.
----------------
NoQ wrote:
> martong wrote:
> > `live` -> `alive` ?
> Ah yes, I'd love me some good ol' `RelaxedAliveVariablesAnalysis` (:
> 
> Dunno why the terminology is made that way (i.e., live as in "live music"), but it seems to be that way :/
I like the wording `live`.


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

https://reviews.llvm.org/D74735





More information about the cfe-commits mailing list