[PATCH] D45650: [CFG] [analyzer] Don't treat argument constructors as temporary constructors.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 13 20:12:35 PDT 2018


NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet.
Herald added subscribers: cfe-commits, rnkovacs.

Function argument constructors (that are used for passing objects into functions by value) are completely unlike temporary object constructors, but we were treating them as such because they are also wrapped into a `CXXBindTemporaryExpr`.

This patch adds a partial construction context layer for call argument values, but doesn't proceed to transform it into an actual construction context yet. This is tells the clients that we aren't supporting these constructors yet.

A lesson to learn here is that construction contexts aren't as safe as i originally expected - even though they work by pattern-matching small specific AST patterns.


Repository:
  rC Clang

https://reviews.llvm.org/D45650

Files:
  lib/Analysis/CFG.cpp
  lib/Analysis/ConstructionContext.cpp
  test/Analysis/cfg-rich-constructors.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45650.142504.patch
Type: text/x-patch
Size: 4560 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180414/36e5b370/attachment.bin>


More information about the cfe-commits mailing list