sivachandra at gmail dot com
2014-10-20 13:35:27 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=17494
Bug ID: 17494
Summary: Ternary operator not evaluated correctly
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: c++
Assignee: unassigned at sourceware dot org
Reporter: sivachandra at gmail dot com
Consider the following code:
class A
{
public:
A () { a = 12345; }
int geta ();
int a;
};
int
A::geta ()
{
return a;
}
int
main ()
{
A a;
return 0; /* Break here */
}
I see this with GDB:
(gdb) p a.geta()
$3 = 12345
(gdb) p false ? a.geta() : 123
$2 = {a = 12345}
The result is of the wrong type (and value).
Similarly:
(gdb) p (true ? 123 : a.geta()) + 1
Can't do that binary op on that type
Bug ID: 17494
Summary: Ternary operator not evaluated correctly
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: c++
Assignee: unassigned at sourceware dot org
Reporter: sivachandra at gmail dot com
Consider the following code:
class A
{
public:
A () { a = 12345; }
int geta ();
int a;
};
int
A::geta ()
{
return a;
}
int
main ()
{
A a;
return 0; /* Break here */
}
I see this with GDB:
(gdb) p a.geta()
$3 = 12345
(gdb) p false ? a.geta() : 123
$2 = {a = 12345}
The result is of the wrong type (and value).
Similarly:
(gdb) p (true ? 123 : a.geta()) + 1
Can't do that binary op on that type
--
You are receiving this mail because:
You are on the CC list for the bug.
You are receiving this mail because:
You are on the CC list for the bug.