This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/10343] New: gdb selects wrong function overload
- From: "andre dot poenitz at nokia dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 29 Jun 2009 10:24:44 -0000
- Subject: [Bug c++/10343] New: gdb selects wrong function overload
- Reply-to: sourceware-bugzilla at sourceware dot org
The following code results in gdb using the
'int *' overload instead of the 'void *' one
when used with a 'char *' argument.
#include <iostream>
int foo(void *p) { std::cerr << "UNKNOWN " << std::endl; }
int foo(int *p) { std::cerr << "INT: " << *p << std::endl; }
struct S {};
int main(int argc, char *argv[])
{
int a = 1;
S b;
char c = 1;
double d = 1;
return a + c;
}
/*
Breakpoint 1, main () at main.cpp:19
19 int a = 1;
(gdb) call foo(&a)
INT: -1081818280
$6 = 134520896
(gdb) call foo(&b)
UNKNOWN
$7 = 134520896
(gdb) call foo(&c)
INT: 141559812
$8 = 134520896
(gdb) call foo(&d)
UNKNOWN
$9 = 134520896
(gdb)
--
Summary: gdb selects wrong function overload
Product: gdb
Version: 6.8
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at sourceware dot org
ReportedBy: andre dot poenitz at nokia dot com
CC: gdb-prs at sourceware dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=10343
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.