efriedma added inline comments.

================
Comment at: clang/lib/AST/Expr.cpp:3444
     if (CE->getCastKind() == CK_NoOp ||
         CE->getCastKind() == CK_LValueToRValue ||
         CE->getCastKind() == CK_ToUnion ||
----------------
nickdesaulniers wrote:
> efriedma wrote:
> > efriedma wrote:
> > > An CK_LValueToRValue conversion needs to change IsForRef (or else you're 
> > > checking whether the address of the value is constant, not the value 
> > > itself).
> > Not sure what I was thinking when I wrote the original comment here.  We 
> > need to bail on LValueToRValue here: the only way to correctly do an 
> > lvalue-to-rvalue conversion is to evaluate the operand as an lvalue, then 
> > convert the resulting lvalue to an rvalue.  We need to use ExprConstant to 
> > do that.
> when you say `we need to bail on LValueToRValue here` do you just `return 
> false` for that case or what?
Probably just "break;".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151587

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to