[PATCH] D69602: [analyzer] Test case for lambda capture by value modelling

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 11:31:47 PDT 2019


NoQ added inline comments.


================
Comment at: clang/test/Analysis/clangsa_unsupported_features/handle_constructors_for_lambda_captures.cpp:29
+  operator=(incr_on_copy_for_simple_usage &&o) = delete;
+  ~incr_on_copy_for_simple_usage() = default;
+};
----------------
NoQ wrote:
> That's the reason why your tests seem to work. If you change it to `~incr_on_copy_for_simple_usage() {}`, we will no longer evaluate the capture correctly.
> 
> The difference here is that we allow ourselves inline the constructor without a construction context when the destructor is trivial. But when the destructor is non-trivial, our inability to keep track of the object under construction until destruction will have terrible consequences.
*allow ourselves to inline


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69602





More information about the cfe-commits mailing list