tbaeder added inline comments.
================
Comment at: clang/test/AST/Interp/loops.cpp:9
+
+namespace WhileLoop {
+ constexpr int f() {
----------------
shafik wrote:
> infinite loop w/o a side effect are undefined behavior and so should be
> ill-formed and generate a diagnostic e.g. `while(1);`, so we should check
> these cases.
I think that's better done with a more general approach that limits the
iteration count for all loops like the current interpreter does. But that
would probably blow up this patch too much.
Unfortunately I can't add test case for the case you describe because the clang
process with the new interpreter would never terminate :) Can add a
commented-out version though.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135433/new/
https://reviews.llvm.org/D135433
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits