[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:58:01 PST 2023


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


================
Comment at: clang/test/AST/Interp/loops.cpp:278
+
+namespace RangeForLoop {
+  constexpr int localArray() {
----------------
aaron.ballman wrote:
> You should also add failure tests where the range-based for loop is not valid in a constant expression. Especially interesting cases would be ones involving lifetime problems, such as: https://godbolt.org/z/3EE7f8rdE
Oof, that reproducer doesn't work right now for several reasons :/ Can you come up with something simpler?


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

https://reviews.llvm.org/D140803



More information about the cfe-commits mailing list