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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 3 22:33:24 PST 2019


rjmccall added a comment.

In D55662#1346059 <https://reviews.llvm.org/D55662#1346059>, @ahatanak wrote:

> In D55662#1346055 <https://reviews.llvm.org/D55662#1346055>, @rjmccall wrote:
>
> > I think you could just disable the diagnostic in an unevaluated context.
>
>
> The call to `isUnevaluatedContext` in `ObjCPropertyOpBuilder::complete` returns false when the type of `auto __weak wp` in `testAuto` is being deduced because the `ExpressionEvaluationContextRecord` on the stack isn't an unevaluated context. I can silence the warning if I can push an unevaluated context at the entry of `Sema::DeduceAutoType`, but it's not clear to me that it's safe to do so.


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


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