[PATCH] D44238: [CFG] Fix automatic destructors when a member is bound to a reference.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 31 16:52:07 PDT 2018


rsmith added inline comments.


================
Comment at: lib/Analysis/CFG.cpp:1435
 /// extended by a local reference with the given initializer.
 static QualType getReferenceInitTemporaryType(ASTContext &Context,
                                               const Expr *Init,
----------------
Can you replace this with `Expr::skipRValueSubobjectAdjustments`? That's how we compute this elsewhere. (You'll need to skip a top-level `ExprWithCleanups` and check for the search terminating in a `MaterializeTemporaryExpr` yourself, but this will reduce duplication and fix a couple more cases this function is getting wrong).


Repository:
  rC Clang

https://reviews.llvm.org/D44238





More information about the cfe-commits mailing list