<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/132179>132179</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [lldb] `operator bool() const` on struct not being resolved in breakpoint condition
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          k4lizen
      </td>
    </tr>
</table>

<pre>
    Using lldb and clang on 01f04252b6711e281d9569172302ec20789e9bbe . Using windows (haven't tried it on linux but I'd assume it reproduces).
```cpp
#include <iostream>

struct Boolish {
    operator bool() const { return false; }
};
int main() {
 Boolish bol;
    if (!(bool)bol) {
        puts("operator resolved correctly!");
    }
    puts("break");
    puts("done");
    return 0;
}
```
Compiling with latest `clang++ main.cpp -g3 -o main.exe`.
Running `./main.exe` gives the expected:
```
operator resolved correctly!
break
done
```
But trying the condition in lldb gives:
```
[snip]
(lldb) breakpoint set -f main.cpp -l 11 --condition "!(bool)bol"
(lldb) run
Process 5476 stopped
* thread #1, stop reason = breakpoint 1.1
    frame #0: 0x00007ff7e3e57186 main.exe`main at main.cpp:52
   49       if (!(bool)bol) {
   50           puts("operator resolved correctly!");
   51       }
-> 52       puts("break");
   53 puts("done");
   54       return 0;
   55   }
error: stopped due to an error evaluating condition of breakpoint 1.1: "!(bool)bol"
Couldn't parse conditional expression:
error: Couldn't look up symbols:
  bool Boolish::operator bool(void)
Hint: The expression tried to call a function that is not present in the target, perhaps because it was optimized out by the compiler.

(lldb)
```
If we remove the `const`, everything works as expected.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVd2u4jYQfhpzMwI5dkLIBRfhnEXdu6pqH8CJJ8Q9xo78wzns01d2ssBhu23VCAHOzHzz981YeK9OBnFPqgOpXlcihtG6_Vup1Tc0q87K6_4Pr8wJtJYdCCOh18KcwBqgxUBLVrFuWxcFs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