[llvm-bugs] [Bug 40189] LLDB expressions always error if a C++ local variable is named after a keyword

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 30 18:05:00 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=40189

Jonas Devlieghere <jdevlieghere at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jdevlieghere at apple.com
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #4 from Jonas Devlieghere <jdevlieghere at apple.com> ---
This was fixed by https://reviews.llvm.org/rL359773

bash-3.2$ echo 'int main(int argc){__func__;}' | g++ -g -x c++ - && lldb -o 'br
s -n main' -o 'pr la' -o 'expr argc' a.out
<stdin>:1:5: warning: only one parameter on 'main' declaration [-Wmain]
int main(int argc){__func__;}
    ^
<stdin>:1:20: warning: expression result unused [-Wunused-value]
int main(int argc){__func__;}
                   ^~~~~~~~
2 warnings generated.
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) br s -n main
Breakpoint 1: where = a.out`main + 9 at <stdin>:1:29, address =
0x0000000100000fa9
(lldb) pr la
Process 51065 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000fa9 a.out`main(argc=1) at <stdin>:1:29
Target 0: (a.out) stopped.

Process 51065 launched: '/private/tmp/a.out' (x86_64)
(lldb) expr argc
(int) $0 = 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190731/32614597/attachment.html>


More information about the llvm-bugs mailing list