I came across a bug for calling functions using expression evaluation, where the function name also matches a symbol from another compile unit.
The attached test case recreates it when compiled with gcc. Clang however doesn't seem to export a conflicting .rodata symbol so the bug doesn't appear.
Currently trying to call the function gives the following error in the test case.
(lldb) expr overloaded_symbol(1) error: warning: got name from symbols: overloaded_symbol error: reference to 'overloaded_symbol' is ambiguous note: candidate found by name lookup is 'overloaded_symbol' note: candidate found by name lookup is 'overloaded_symbol' error: 1 errors parsing expression
This patch in the clang expression parser stops us turning the symbol into a global variable declaration if we've already found
a matching function. I'm not familiar with this code, so if there's a better way to fix this please let me know.