[lldb-dev] [Bug 39459] New: Enum class variables can't be used as function arguments
via lldb-dev
lldb-dev at lists.llvm.org
Fri Oct 26 14:07:11 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=39459
Bug ID: 39459
Summary: Enum class variables can't be used as function
arguments
Product: lldb
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: lldb-dev at lists.llvm.org
Reporter: clayborg at gmail.com
CC: llvm-bugs at lists.llvm.org
Compile the following code
enum class Foo : short {
a,b,c
};
bool UseFoo(Foo f) {
return (bool)f;
}
int main() {
Foo foo = Foo::a;
auto r = UseFoo(foo); // breakpoint
}
Then debug it and try to call "UseFoo" with an enumeration:
$ lldb a.out
(lldb) target create "a.out"
(lldb) b /breakpoint/
(lldb) r
Process 98692 launched: '/tmp/a.out' (x86_64)
Process 98692 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000100000f9e a.out`main at /tmp/main.cpp:11
8
9 int main() {
10 Foo foo = Foo::a;
-> 11 auto r = UseFoo(foo); // breakpoint
12 }
13
Target 0: (a.out) stopped.
(lldb) p UseFoo(Foo::b)
error: no matching function for call to 'UseFoo'
candidate function not viable: no known conversion from 'short' to 'Foo' for
1st argument
(lldb) p UseFoo((Foo)Foo::b)
(bool) $0 = true
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20181026/0d21ccb2/attachment.html>
More information about the lldb-dev
mailing list