aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/overload.cc
diff options
context:
space:
mode:
authorSami Wagiaalla <swagiaal@redhat.com>2010-10-14 16:13:43 +0000
committerSami Wagiaalla <swagiaal@redhat.com>2010-10-14 16:13:43 +0000
commit7062b0a0dfe70957e9cb04749efb627a3032c3f2 (patch)
tree304772526bc6562280716509edb63433a0bc3eab /gdb/testsuite/gdb.cp/overload.cc
parent5c3da5ea2ef28d1f272e737e5165d671149291a0 (diff)
downloadgdb-7062b0a0dfe70957e9cb04749efb627a3032c3f2.zip
gdb-7062b0a0dfe70957e9cb04749efb627a3032c3f2.tar.gz
gdb-7062b0a0dfe70957e9cb04749efb627a3032c3f2.tar.bz2
Fixed void* vs int* overload issue (PR C++/10343).
2010-10-14 Sami Wagiaalla <swagiaal@redhat.com> * gdbtypes.h: Create BASE_PTR_CONVERSION_BADNESS. * gdbtypes.c (rank_one_type): Move type comparison code out of here to... (types_equal): ...here. And changed it as follows: Outside of typedefs type must be of the same TYPE_CODE. When compairing two pointers or references they are equal if their targets are equal. Correct pointer conversions. 2010-10-14 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/converts.cc: New test program. * gdb.cp/converts.exp: New test. * gdb.cp/overload.exp: Added test for void* vs int*. * gdb.cp/overload.exp: Ditto. * gdb.cp/oranking.exp: Removed related kfail.
Diffstat (limited to 'gdb/testsuite/gdb.cp/overload.cc')
-rw-r--r--gdb/testsuite/gdb.cp/overload.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/overload.cc b/gdb/testsuite/gdb.cp/overload.cc
index 78fae14..dc117fb 100644
--- a/gdb/testsuite/gdb.cp/overload.cc
+++ b/gdb/testsuite/gdb.cp/overload.cc
@@ -24,6 +24,9 @@ int overload1arg (unsigned long);
int overload1arg (float);
int overload1arg (double);
+int overload1arg (int*);
+int overload1arg (void*);
+
int overloadfnarg (void);
int overloadfnarg (int);
int overloadfnarg (int, int (*) (int));
@@ -99,6 +102,8 @@ int main ()
unsigned long arg10 =10;
float arg11 =100.0;
double arg12 = 200.0;
+ int arg13 = 200.0;
+ char arg14 = 'a';
char *str = (char *) "A";
foo foo_instance1(111);
@@ -150,6 +155,8 @@ int foo::overload1arg (long arg) { arg = 0; return 9;}
int foo::overload1arg (unsigned long arg) { arg = 0; return 10;}
int foo::overload1arg (float arg) { arg = 0; return 11;}
int foo::overload1arg (double arg) { arg = 0; return 12;}
+int foo::overload1arg (int* arg) { arg = 0; return 13;}
+int foo::overload1arg (void* arg) { arg = 0; return 14;}
/* Test to see that we can explicitly request overloaded functions
with function pointers in the prototype. */