Issue 89506
Summary clang-repl can not correctly execute top-level for-loop statements
Labels new issue
Assignees
Reporter wlonestar
    Consider the following piece of code:
```cpp
for (int i = 0; i < 3; i++) {
  for (int j = 0; j < 3; j++) {
    std::cout << i << ":" << j << "\n";
 }
}
```
When running this code in `clang-repl` I found it will set `i`, `j` as global variables, so the output will be:
```
0:0
0:1
0:2
```
I have to put the double loops into a function and execute the function, but this contradicts the original intention of the usage of interpreter.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to