[PATCH] D107078: [analyzer] Catch leaking stack addresses via stack variables
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 30 06:31:13 PDT 2021
martong added inline comments.
================
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
----------------
steakhal wrote:
> 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.
If copy elision always occur then `DNO_ELIDE_FLAG` has no effect, and as such it is misleading to have it in this RUN line.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107078/new/
https://reviews.llvm.org/D107078
More information about the cfe-commits
mailing list