[PATCH] D149965: [clang][Interp] Fix tests for ignored expressions
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 8 09:25:27 PDT 2023
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:593-594
+ if (DiscardResult)
+ return true;
+
----------------
tbaeder wrote:
> aaron.ballman wrote:
> > For my own understanding -- why do we not need to call `discard()` on the operand expression?
> Is it ever legal to have an argument expr with side effects (in cases the constant expression interpreter needs to handle)? That's really the only reason I did it this way.
Ah, I see! No, I don't think it's possible to have an expression argument with side effects that's valid in a constant expression for these operators.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149965/new/
https://reviews.llvm.org/D149965
More information about the cfe-commits
mailing list