diff options
author | Tom Tromey <tromey@redhat.com> | 2013-03-25 17:26:18 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-03-25 17:26:18 +0000 |
commit | 1f8a1ced4eefa4c6052a3e4566781527373eff45 (patch) | |
tree | 8845b0f8810d3350597c40e1b9b0574b7b7c092d /gdb/eval.c | |
parent | 39b93559981072aa31534d1a5496fa920e8fa694 (diff) | |
download | gdb-1f8a1ced4eefa4c6052a3e4566781527373eff45.tar.gz |
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.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r-- | gdb/eval.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/gdb/eval.c b/gdb/eval.c index 146840e7843..a91ba2271ab 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1847,18 +1847,9 @@ evaluate_subexp_standard (struct type *expect_type, arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; - if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (lookup_struct_elt_type (value_type (arg1), - &exp->elts[pc + 2].string, - 0), - lval_memory); - else - { - struct value *temp = arg1; - - return value_struct_elt (&temp, NULL, &exp->elts[pc + 2].string, - NULL, "structure"); - } + /* Also handle EVAL_AVOID_SIDE_EFFECTS. */ + return value_struct_elt (&arg1, NULL, &exp->elts[pc + 2].string, + NULL, "structure"); case STRUCTOP_PTR: tem = longest_to_int (exp->elts[pc + 1].longconst); @@ -1908,18 +1899,9 @@ evaluate_subexp_standard (struct type *expect_type, } } - if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (lookup_struct_elt_type (value_type (arg1), - &exp->elts[pc + 2].string, - 0), - lval_memory); - else - { - struct value *temp = arg1; - - return value_struct_elt (&temp, NULL, &exp->elts[pc + 2].string, - NULL, "structure pointer"); - } + /* Also handle EVAL_AVOID_SIDE_EFFECTS. */ + return value_struct_elt (&arg1, NULL, &exp->elts[pc + 2].string, + NULL, "structure pointer"); case STRUCTOP_MEMBER: case STRUCTOP_MPTR: |