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

2020-11-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:916-918 + virtual const CXXInheritedCtorInitExpr *getOriginExpr() const { +return cast(AnyFunctionCall::getOriginExpr()); + } NoQ wrote: >

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

2020-11-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:916-918 + virtual const CXXInheritedCtorInitExpr *getOriginExpr() const { +return cast(AnyFunctionCall::getOriginExpr()); + } steakhal wrote: > Why is

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

2020-11-03 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments. Herald added a subscriber: ASDenysPetrov. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:916-918 + virtual const CXXInheritedCtorInitExpr *getOriginExpr() const { +return cast(AnyFunctionCall::getOriginExpr());

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

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @steakhal There is a fix for the crash: https://reviews.llvm.org/D75678 Let's hope that patch get's in soon. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74735/new/ https://reviews.llvm.org/D74735

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

2020-03-06 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Herald added a subscriber: danielkiss. This patch introduced a crash while I was analyzing the libpressio . I was using the `CodeChecker` to drive the analysis with the `--enable-all` flag. The exact command was the following:

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

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks Richard for the explanation. Artem, I think this justifies your suggestion to skip the analysis of inherited constructors as top level functions. I just created the patch https://reviews.llvm.org/D75678 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2020-03-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In D74735#1906764 , @rsmith wrote: > Just in case this isn't clear: the reason why `CXXInheritedCtorInitExpr` > doesn't take arguments and doesn't model parameter initialization is because > there is none: the arguments in the outer

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

2020-03-04 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. > There are also no argument expressions, even though the inherited constructor > for `A` takes one argument `x`. The current patch takes argument expressions > from the topmost `CXXConstructExpr`, which also requires a different location > context to access. As far as

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

2020-03-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. In D74735#1903503 , @martong wrote: > @NoQ > > I've found the following reproducer to crash in `CallAndMessageChecker`: > > class a { > public: > a(int); > }; > struct b : a { > using a::a; > }; > void c() { >

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

2020-03-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @NoQ I've found the following reproducer to crash in `CallAndMessageChecker`: class a { public: a(int); }; struct b : a { using a::a; }; void c() { int d; b x(d); //Crash!, Note, x(0) causes no crash } I am working on a fix, but any

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

2020-03-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:932 + const CXXConstructExpr *getInheritingConstructor() const { +return cast(getInheritingStackFrame()->getCallSite()); + } martong wrote: > This

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

2020-03-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:932 + const CXXConstructExpr *getInheritingConstructor() const { +return cast(getInheritingStackFrame()->getCallSite()); + } This line causes a

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

2020-02-25 Thread Artem Dergachev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa82ffe9d93a2: [analyzer] Add support for CXXInheritedCtorInitExpr. (authored by dergachev.a). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74735/new/

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

2020-02-23 Thread Artem Dergachev via Phabricator via cfe-commits
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

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

2020-02-23 Thread Csaba Dabis via Phabricator via cfe-commits
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:

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

2020-02-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 246127. NoQ marked an inline comment as done. NoQ added a reviewer: martong. NoQ removed a subscriber: martong. NoQ added a comment. - Update `AnyCall` to support inherited constructors as well. This fixes a crash in `RetainCountChecker`. - Introduce a common

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

2020-02-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ marked 6 inline comments as done. NoQ added inline comments. 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 {

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

2020-02-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:436 case CXXConstructExpr::CK_Complete: { +assert(CE && "Complete constructors cannot be inherited!"); std::tie(State, Target) = NoQ wrote: > martong wrote: >

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

2020-02-18 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ marked 2 inline comments as done. NoQ added a comment. In D74735#1880617 , @baloghadamsoftware wrote: > In D74735#1880390 , @xazax.hun wrote: > > > If the AST is hard to work with would it make sense to try to

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

2020-02-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:436 case CXXConstructExpr::CK_Complete: { +assert(CE && "Complete constructors cannot be inherited!"); std::tie(State, Target) = baloghadamsoftware wrote: >

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

2020-02-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D74735#1880390 , @xazax.hun wrote: > If the AST is hard to work with would it make sense to try to change the AST > a bit? Hmm, you mean making `CXXConstructExpr` an abstract base with subclasses

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

2020-02-18 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. If the AST is hard to work with would it make sense to try to change the AST a bit? Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:944 + if (Data) { +loc::MemRegionVal MV(static_cast(Data)); +if (SymbolRef Sym =

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

2020-02-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. 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 { Perhaps the example

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

2020-02-17 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. NoQ added reviewers: dcoughlin, xazax.hun, rnkovacs, Szelethus, baloghadamsoftware, Charusso. Herald added subscribers: cfe-commits, martong, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, kristof.beyls. Herald added a project: clang.