shafik added inline comments.

================
Comment at: clang/test/AST/Interp/loops.cpp:9
+
+namespace WhileLoop {
+  constexpr int f() {
----------------
tbaeder wrote:
> 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.
I think that is fine approach for now.


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

https://reviews.llvm.org/D135433

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to