aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/converts.cc
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2011-10-14 20:22:50 +0000
committerKeith Seitz <keiths@redhat.com>2011-10-14 20:22:50 +0000
commit6501c2fce12bc44b5759a33c2c7259cfdb4169e1 (patch)
tree98b44c2b3f19b5ed2e2b24a92883083bd6c53e4b /gdb/testsuite/gdb.cp/converts.cc
parentda096638ca5fcd2fdb2ff8aff9e545c9b0cee478 (diff)
downloadfsf-binutils-gdb-6501c2fce12bc44b5759a33c2c7259cfdb4169e1.zip
fsf-binutils-gdb-6501c2fce12bc44b5759a33c2c7259cfdb4169e1.tar.gz
fsf-binutils-gdb-6501c2fce12bc44b5759a33c2c7259cfdb4169e1.tar.bz2
PR c++/13225
* gdb.cp/converts.cc (foo3_1): New function. (foo3_2): New functions. * gdb.cp/converts.exp: Add tests for int to pointer conversion and null pointer conversions of integer constant zero. Add test to check if all arguments are checked for incompatible conversion BADNESS.
Diffstat (limited to 'gdb/testsuite/gdb.cp/converts.cc')
-rw-r--r--gdb/testsuite/gdb.cp/converts.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/converts.cc b/gdb/testsuite/gdb.cp/converts.cc
index 34b6927..26a45f5 100644
--- a/gdb/testsuite/gdb.cp/converts.cc
+++ b/gdb/testsuite/gdb.cp/converts.cc
@@ -23,6 +23,10 @@ int foo2_2 (char[][1]) {return 22;}
int foo2_3 (char *[]) {return 23;}
int foo2_4 (int *[]) {return 24;}
+int foo3_1 (int a, const char **b) { return 31; }
+int foo3_2 (int a, int b) { return 32; }
+int foo3_2 (int a, const char **b) { return 320; }
+
int main()
{
@@ -53,5 +57,10 @@ int main()
foo2_2 (ba); // ..array of arrays
foo2_3 (b); // ..array of pointers
foo2_4 ((int**)b); // ..array of wrong pointers
+
+ foo3_1 (0, 0);
+ foo3_2 (0, static_cast<char const**> (0));
+ foo3_2 (0, 0);
+
return 0; // end of main
}