Issue 146770
Summary clang-repl Typing an error in a formula may be followed by an unresolved while linking error
Labels new issue
Assignees
Reporter guitargeek
    In some cases, `clang-repl` doesn't recover correctly from input errors, resulting in a state where unexpected linker errors can happen in correct statements given afterwards.

It seems that this kind of error occurs only with "pow".

@vgvassilev @Vipul-Cariappa 

Reproducer (I ran it with the LLVM 20 packages in NixOS):

```txt
LLVM (http://llvm.org/):
  LLVM version 20.1.6
  Optimized build.
```

```txt
clang-repl> #include <iostream>
clang-repl> #include <cmath>
clang-repl> (10-)*std::pow(2,2);
In file included from <<< inputs >>>:1:
input_line_3:1:5: error: expected _expression_
    1 | (10-)*std::pow(2,2);
      |     ^
error: Parsing failed.
clang-repl> std::cout << ((10-1)*std::pow(2,2)) << std::endl;
JIT session error: Symbols not found: [ _ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_ ]
error: Failed to materialize symbols: { (main, { $.incr_module_3.__inits.0, __orc_init_func.incr_module_3 }) }
clang-repl>
```

What is expected:
```txt
clang-repl> #include <iostream>
clang-repl> #include <cmath>
clang-repl> (10-)*std::pow(2,2);
In file included from <<< inputs >>>:1:
input_line_3:1:5: error: expected _expression_
    1 | (10-)*std::pow(2,2);
      |     ^
error: Parsing failed.
clang-repl> std::cout << ((10-1)*std::pow(2,2)) << std::endl;
36
clang-repl>
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to