aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/converts.exp
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2012-09-10 17:12:53 +0000
committerKeith Seitz <keiths@redhat.com>2012-09-10 17:12:53 +0000
commit5b4f6e25c3d9e1d51c35ca0d5000ea0b32b26a81 (patch)
tree01804b106dd08a6ae2f5eb014cc7b573bb4066b0 /gdb/testsuite/gdb.cp/converts.exp
parent6d2920c847e9f9719d30f38ae94a8cce221edd97 (diff)
downloadfsf-binutils-gdb-5b4f6e25c3d9e1d51c35ca0d5000ea0b32b26a81.zip
fsf-binutils-gdb-5b4f6e25c3d9e1d51c35ca0d5000ea0b32b26a81.tar.gz
fsf-binutils-gdb-5b4f6e25c3d9e1d51c35ca0d5000ea0b32b26a81.tar.bz2
PR gdb/13483
* gdbtypes.h (BOOL_PTR_CONVERSION_BADNESS): Rename to ... (BOOL_CONVERSION_BADNESS): ... this. * gdbtypes.c (BOOL_PTR_CONVERSION_BADNESS): Likewise. (rank_one_type): Allow all boolean conversions permitted by the standard. * gdb.cp/converts.cc (A::A): Add ctor. (A::member_): Add member. (enum my_enum): New enumeration. (main): Add calls to foo1_7 with various permitted arguments. * gdb.cp/converts.exp: Add tests for boolean conversions permitted by the standard.
Diffstat (limited to 'gdb/testsuite/gdb.cp/converts.exp')
-rw-r--r--gdb/testsuite/gdb.cp/converts.exp15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/converts.exp b/gdb/testsuite/gdb.cp/converts.exp
index 414e2d0..148ac0f 100644
--- a/gdb/testsuite/gdb.cp/converts.exp
+++ b/gdb/testsuite/gdb.cp/converts.exp
@@ -77,6 +77,21 @@ gdb_test "p foo3_1 (0, (const char**) 1)" " = 31"
gdb_test "p foo3_2 (0, 0)" "= 32"
gdb_test "p foo3_2 (0, (char const**) 0)" " = 320"
+# Tests for boolean conversions allowed by the standard
+gdb_test "p foo1_7(0)" " = 17"
+gdb_test "p foo1_7(integer)" " = 17"
+gdb_test "p foo1_7(long_int)" " = 17"
+gdb_test "p foo1_7(*a)" " = 17"
+gdb_test "p foo1_7(MY_A)" " = 17"
+gdb_test "p foo1_7(&foo1_7)" " = 17"
+gdb_test "p foo1_7(&A::member_)" " = 17"
+gdb_test "p foo1_7(a)" " = 17"
+gdb_test "p foo1_7(fp)" " = 17"
+gdb_test "p foo1_7(dp)" " = 17"
+gdb_test "p foo1_7(-1.23)" " = 17"
+gdb_test "p foo1_7(ta)" \
+ "Cannot resolve function foo1_7 to any overloaded instance"
+
# Test for strict type checking
set error_str "Cannot resolve function %s to any overloaded instance"
gdb_test "show check type" "Strict type checking is on\."