[PATCH] D103938: Diagnose -Wunused-value in constant evaluation context

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 28 15:58:00 PDT 2021


ychen added a comment.

In D103938#2836470 <https://reviews.llvm.org/D103938#2836470>, @rsmith wrote:

> I've given this some more thought, and I think it's only the "constant evaluated" check that we want to bypass in this case. It's common to use `sizeof` or `decltype` with a comma operator in order to put an expression in a SFINAE context, and I don't think we should warn on those cases. So I think we should still do the context check for `DiagIfReachable`, but only bail out for unevaluated contexts, not for constant-evaluated contexts. Does that seem reasonable?

Yeah, it is reasonable and seems already in place (https://reviews.llvm.org/rG78ecb8737d97a038770af9f6a1ad1d7925c87eb7).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103938



More information about the cfe-commits mailing list