[PATCH] D52008: [analyzer] Handle forwarding reference better in ExprMutationAnalyzer.

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 13 02:39:57 PDT 2018


lebedev.ri added a comment.

Thanks for working on this! I tried, and it appears to not fix the issue at hand.

-

  struct C1 {
    C1(const C1* c, int num);
  };
  
  int x = 0;
  auto y = std::make_unique<C1>(nullptr, x); // <- still considered a mutation?

-

  struct C3 {}; // some class
  
  struct C2 {
    C2(const int* whatever, int n, C3 zz);
  };
  
  int x = 0;
  std::vector<C2> v;
  v.emplace_back(nullptr, x, {}); // <- still considered a mutation?

And so on. These are hand-reduced, so hopefully you can reproduce?



================
Comment at: include/clang/Analysis/Analyses/ExprMutationAnalyzer.h:32
   const Stmt *findMutation(const Expr *Exp);
+  const Stmt *findDeclMutation(const Decl *Dec);
 
----------------
Thanks!
I know this has performance implications, but those will exist even if one has this in his own code.


Repository:
  rC Clang

https://reviews.llvm.org/D52008





More information about the cfe-commits mailing list