[PATCH] D55662: [Sema][ObjC] Do not warn about repeated uses of weak variables when the variables are accessed in an unevaluated context.

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 4 18:38:50 PST 2019


ahatanak added a comment.

In D55662#1346077 <https://reviews.llvm.org/D55662#1346077>, @rjmccall wrote:

> Hmm.  Are we resolving the placeholder expression twice here?  That might be the basic problem.


Yes, `CheckPlaceholderExpr` is called in `Sema::DeduceAutoType` to deduce the type of the auto variable and then called again when `InitializationSequence::InitializeFrom` generates the Expr for initialization.

If we want to avoid calling `CheckPlaceholderExpr` twice, I think it's possible to cache the results of `ObjCPropertyOpBuilder::buildRValueOperation` in Sema. Alternatively, we can just pass down a flag that indicates we are deducing auto types and pass it to the constructor of `ObjCPropertyOpBuilder`.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55662





More information about the cfe-commits mailing list