diff options
author | Sami Wagiaalla <swagiaal@redhat.com> | 2010-07-21 14:59:05 +0000 |
---|---|---|
committer | Sami Wagiaalla <swagiaal@redhat.com> | 2010-07-21 14:59:05 +0000 |
commit | 883df6ddea77e818a9d516c3d1b34467c71a7b3d (patch) | |
tree | 8e626c3c5314011f3d130e97d5aca9414de8c50e /gdb/testsuite/gdb.cp/fpointer.cc | |
parent | 269b11a298661a350ca79807544d0b58b7d18a3d (diff) | |
download | fsf-binutils-gdb-883df6ddea77e818a9d516c3d1b34467c71a7b3d.zip fsf-binutils-gdb-883df6ddea77e818a9d516c3d1b34467c71a7b3d.tar.gz fsf-binutils-gdb-883df6ddea77e818a9d516c3d1b34467c71a7b3d.tar.bz2 |
Corrected pre-overload-resolution function evaluation.
2010-07-21 Sami Wagiaalla <swagiaal@redhat.com>
* eval.c (evaluate_subexp_standard): Disabled evaluation of C++
function symbols before overload resolution.
2010-07-21 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/fpointer.cc: New test.
* gdb.cp/fpointer.exp: New test.
Diffstat (limited to 'gdb/testsuite/gdb.cp/fpointer.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/fpointer.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/fpointer.cc b/gdb/testsuite/gdb.cp/fpointer.cc new file mode 100644 index 0000000..007ea39 --- /dev/null +++ b/gdb/testsuite/gdb.cp/fpointer.cc @@ -0,0 +1,40 @@ +#include "stdio.h" + +int foo(){ + return 11; +} + +int bar(){ + return 12; +} + +int bar(int){ + printf ("bar(int)\n"); + return 13; +} + +int bar(char){ + printf ("bar(char)\n"); + return 14; +} + +int (*p1)() = &foo; +int (*p2)() = &bar; +int (*p[2])() = {p1,p2}; + +int (*p3)(int) = &bar; +int (*p4)(char) = &bar; + +int main () +{ + p1 (); + p2 (); + + p[0](); + p[1](); + + p3 ('a'); + p4 (1); + + return 0; +} |