PR c++/9197:
* opencl-lang.c (evaluate_subexp_opencl) <STRUCTOP_STRUCT>: Use value_struct_elt, not lookup_struct_elt_type. * eval.c (evaluate_subexp_standard) <STRUCTOP_STRUCT, STRUCTOP_PTR>: Use value_struct_elt, not lookup_struct_elt_type. * expression.h (EVAL_AVOID_SIDE_EFFECTS): Update comment. gdb/testsuite * gdb.cp/m-static.exp: Add constructor ptype tests. * gdb.cp/m-static.cc (single_constructor): New class. (main): Make instance of single_constructor.
This commit is contained in:
parent
f6f0e17bc3
commit
fce632b6dc
7 changed files with 48 additions and 34 deletions
|
@ -31,6 +31,14 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
// An object with a single constructor.
|
||||
class single_constructor
|
||||
{
|
||||
public:
|
||||
single_constructor () { }
|
||||
~single_constructor () { }
|
||||
};
|
||||
|
||||
const bool gnu_obj_1::test;
|
||||
const int gnu_obj_1::key1;
|
||||
long gnu_obj_1::key2 = 77;
|
||||
|
@ -81,6 +89,7 @@ int main()
|
|||
gnu_obj_2<long> test2(roman);
|
||||
gnu_obj_3<long> test3(greek);
|
||||
gnu_obj_4 test4;
|
||||
single_constructor test5;
|
||||
|
||||
test4.dummy = test4.elsewhere;
|
||||
test4.dummy = 0;
|
||||
|
|
|
@ -69,6 +69,16 @@ gdb_test "print test1.key2" "\\$\[0-9\]* = 77" "simple object, static long"
|
|||
# simple object, static enum
|
||||
gdb_test "print test1.value" "\\$\[0-9\]* = oriental" "simple object, static enum"
|
||||
|
||||
gdb_test "print test5.single_constructor" \
|
||||
{ = {void \(single_constructor \* const\)} 0x[0-9a-f]+ <single_constructor::single_constructor\(\)>} \
|
||||
"simple object instance, print constructor"
|
||||
gdb_test "ptype test5.single_constructor" \
|
||||
{type = void \(single_constructor \* const\)} \
|
||||
"simple object instance, ptype constructor"
|
||||
gdb_test "ptype single_constructor::single_constructor" \
|
||||
{type = void \(single_constructor \* const\)} \
|
||||
"simple object class, ptype constructor"
|
||||
|
||||
gdb_test "print test1.'~gnu_obj_1'" \
|
||||
{ = {void \(gnu_obj_1 \*( const)?, int\)} 0x[0-9a-f]+ <gnu_obj_1::~gnu_obj_1\(\)>} \
|
||||
"simple object instance, print quoted destructor"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue