[PATCH] D44955: [CFG] [analyzer] Work around a disappearing CXXBindTemporaryExpr.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 27 13:48:01 PDT 2018


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

This is a CFG-side patch for the weird AST i encountered in http://lists.llvm.org/pipermail/cfe-dev/2018-March/057398.html . The omission of the `CXXBindTemporaryExpr` causes a crash because it produces an unexpected construction context for a temporary object that requires non-trivial destruction.

I removed the crashing assertion for now, together with the ill-formed construction context. Temporary destructor is still missing from the CFG in this case, so it was important to remove the construction context, so that not to try modeling the constructor when the destructor is completely missing.

CodeGen works fine because they defensively destroy everything they ever wanted to destroy at `ExprWithCleanups`.


Repository:
  rC Clang

https://reviews.llvm.org/D44955

Files:
  include/clang/Analysis/ConstructionContext.h
  lib/Analysis/CFG.cpp
  lib/Analysis/ConstructionContext.cpp
  test/Analysis/missing-bind-temporary.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44955.139995.patch
Type: text/x-patch
Size: 7297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180327/2d6d497b/attachment.bin>


More information about the cfe-commits mailing list