[PATCH] D140803: [clang][Interp] Implement C++ Range-for loops

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 24 00:45:37 PST 2023


tbaeder marked an inline comment as done.
tbaeder added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeStmtGen.cpp:418-419
+  this->emitLabel(IncLabel);
+  if (Inc && !this->discard(Inc))
+    return false;
+  if (!this->jump(CondLabel))
----------------
aaron.ballman wrote:
> Under what circumstances is there not an increment?
The answer to both is that I looked at the code for regular `for` loops and assumed that the restrictions are the same.

But looks like there aren't and even `isBody()` always returns non-null.


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

https://reviews.llvm.org/D140803



More information about the cfe-commits mailing list