diff options
author | Sami Wagiaalla <swagiaal@redhat.com> | 2010-10-19 16:07:25 +0000 |
---|---|---|
committer | Sami Wagiaalla <swagiaal@redhat.com> | 2010-10-19 16:07:25 +0000 |
commit | 026ffab798b81c8b752a5b277361efec7b96b564 (patch) | |
tree | 780fd99d7b027c2a30c25d95101a430aa2476207 /gdb/testsuite/gdb.cp/converts.cc | |
parent | 20f5cfbdeace664dca0f967e4f20fa45e37947d5 (diff) | |
download | fsf-binutils-gdb-026ffab798b81c8b752a5b277361efec7b96b564.zip fsf-binutils-gdb-026ffab798b81c8b752a5b277361efec7b96b564.tar.gz fsf-binutils-gdb-026ffab798b81c8b752a5b277361efec7b96b564.tar.bz2 |
Support pointer to bool conversion.
2010-10-19 Sami Wagiaalla <swagiaal@redhat.com>
* gdbtypes.h: Introduce BOOL_PTR_CONVERSION_BADNESS.
* gdbtypes.c (rank_one_type): Use BOOL_PTR_CONVERSION_BADNESS
for conversion.
Make all other conversions illegal.
2010-10-19 Sami Wagiaalla <swagiaal@redhat.com>
* gdb.cp/converts.exp: Test pointer to bool conversion.
Test pointer to long conversion.
* gdb.cp/oranking.exp: Removed relevant kfail.
Diffstat (limited to 'gdb/testsuite/gdb.cp/converts.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/converts.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.cp/converts.cc b/gdb/testsuite/gdb.cp/converts.cc index b5e7bde..34b6927 100644 --- a/gdb/testsuite/gdb.cp/converts.cc +++ b/gdb/testsuite/gdb.cp/converts.cc @@ -14,7 +14,9 @@ int foo1_2 (char[]) {return 12;} int foo1_3 (int*) {return 13;} int foo1_4 (A*) {return 14;} int foo1_5 (void*) {return 15;} -int foo1_6 (void**) {return 15;} +int foo1_6 (void**) {return 16;} +int foo1_7 (bool) {return 17;} +int foo1_8 (long) {return 18;} int foo2_1 (char** ) {return 21;} int foo2_2 (char[][1]) {return 22;} @@ -40,7 +42,9 @@ int main() foo1_3 ((int*)bp); // ..pointer of wrong type foo1_4 (bp); // ..ancestor pointer foo1_5 (bp); // ..void pointer - foo1_6 ((void**)bp); // ..void pointer + foo1_6 ((void**)bp); // ..void pointer pointer + foo1_7 (bp); // ..boolean + foo1_8 ((long)bp); // ..long int char **b; // pointer pointer to.. char ba[1][1]; |