[PATCH] D129755: Thread safety analysis: Support copy-elided production of scoped capabilities through arbitrary calls

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 17:54:54 PDT 2022


aaronpuchert added inline comments.


================
Comment at: clang/lib/Analysis/ThreadSafety.cpp:1789
+      auto inserted = ConstructedObjects.insert({Exp, Placeholder.first});
+      assert(inserted.second && "Are we visiting the same expression again?");
+      if (isa<CXXConstructExpr>(Exp))
----------------
chapuni wrote:
> 'inserted' is used only here.
Correct, is that an issue? Perhaps `-Wunused-variable` in Release builds?

Otherwise I believe it's correct—we don't need the iterator and we should generally not insert expressions twice, hence the assertion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129755



More information about the cfe-commits mailing list