================
@@ -9325,6 +9325,9 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExpr 
*E) {
       Result.IsNullPtr = false;
       return true;
     } else {
+      if (!Value.isLValue())
----------------
AaronBallman wrote:

I think it's worth adding a comment here explaining under what circumstances 
this wouldn't be an lvalue. Something along the lines of "In rare instances, 
the value isn't an lvalue. For example, when the value is the difference 
between the address of two labels. We reject that as a constant expression 
because we can't compute a valid offset to convert into a pointer."

https://github.com/llvm/llvm-project/pull/95479
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to