[PATCH] D78134: [Sema] Don't apply an lvalue-to-rvalue conversion to a discarded-value expression if it has an array type

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 17:25:48 PDT 2020


rjmccall added a comment.

In D78134#1982291 <https://reviews.llvm.org/D78134#1982291>, @rsmith wrote:

> In D78134#1981866 <https://reviews.llvm.org/D78134#1981866>, @rsmith wrote:
>
> > I'm going to take this to CWG.
>
>
> So far, the direction the wind is blowing is that attempting to perform an lvalue-to-rvalue conversion on an array should be a no-op. (That's weirdly different from the behavior on a class, but so be it.)


Okay.  It's probably easiest and most correct to do that check in `DefaultLvalueConversion`, since otherwise callers would also have to do placeholder conversions.  We use `DefaultLvalueConversion` a lot in Sema, apparently mostly in places where subsequent type restrictions disallow both arrays and decayed arrays; I'll admit to running out of energy after checking the first half-dozen matches, though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78134





More information about the cfe-commits mailing list