[PATCH] D107078: [analyzer] Catch leaking stack addresses via stack variables

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 29 08:40:27 PDT 2021


steakhal marked an inline comment as done.
steakhal added a comment.

Thanks for the quick response.



================
Comment at: clang/test/Analysis/copy-elision.cpp:9-10
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -std=c++17 \
+// RUN:    -analyzer-config elide-constructors=false -DNO_ELIDE_FLAG              \
+// RUN:    -analyzer-config eagerly-assume=false -verify %s
 
----------------
martong wrote:
> Should we use `-verify=no-elide` here as well? Since we set the `DNO_ELIDE_FLAG`?
According to  the comment a few lines below:
> Copy elision always occurs in C++17, otherwise it's under an on-by-default flag.

So I think even though one passes the `elide-constructors=false` analyzer config, we follow the language semantics, which requires us to elide those copies, thus no copy should happen.


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

https://reviews.llvm.org/D107078



More information about the cfe-commits mailing list