aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r--gdb/testsuite/gdb.cp/cpexprs.cc2
-rw-r--r--gdb/testsuite/gdb.cp/cpexprs.exp16
2 files changed, 18 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/cpexprs.cc b/gdb/testsuite/gdb.cp/cpexprs.cc
index f70fd51..a2364eb 100644
--- a/gdb/testsuite/gdb.cp/cpexprs.cc
+++ b/gdb/testsuite/gdb.cp/cpexprs.cc
@@ -270,6 +270,7 @@ public:
operator int () const { return 21; } // base::operator int
operator fluff* () const { return new fluff (); } // base::operator fluff*
operator fluff** () const { return &g_fluff; } // base::operator fluff**
+ operator fluff const* const* () const { return &g_fluff; } // base::operator fluff const* const*
};
class base1 : public virtual base
@@ -448,6 +449,7 @@ test_function (int argc, char* argv[]) // test_function
char* str = a;
fluff* flp = a;
fluff** flpp = a;
+ fluff const* const* flcpcp = a;
CV_f(CV::i);
diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp b/gdb/testsuite/gdb.cp/cpexprs.exp
index d0f41b2..463e89c 100644
--- a/gdb/testsuite/gdb.cp/cpexprs.exp
+++ b/gdb/testsuite/gdb.cp/cpexprs.exp
@@ -407,6 +407,10 @@ add {base::operator int} \
{int (const base * const)} \
- \
-
+add {base::operator fluff const* const*} \
+ {const fluff * const *(const base * const)} \
+ - \
+ -
# Templates
add {tclass<char>::do_something} \
@@ -746,5 +750,17 @@ gdb_test "p CV_f(CV::i)" " = 43"
gdb_test "p CV_f('cpexprs.cc'::CV::t)" \
{ = {int \(int\)} 0x[0-9a-f]+ <CV_f\(int\)>}
+# Make sure conversion operator names are canonicalized and properly
+# "spelled."
+gdb_test "p base::operator const fluff * const *" \
+ [get "base::operator fluff const* const*" print] \
+ "canonicalized conversion operator name 1"
+gdb_test "p base::operator const fluff* const*" \
+ [get "base::operator fluff const* const*" print] \
+ "canonicalized conversion operator name 2"
+gdb_test "p base::operator derived*" \
+ "There is no field named operator derived\\*" \
+ "undefined conversion operator"
+
gdb_exit
return 0