+2013-02-14 Pedro Alves <palves@redhat.com>
+
+ * eval.c (evaluate_subexp_for_address) <default_case_after_eval,
+ EVAL_AVOID_SIDE_EFFECTS>: Swap and handle TYPE_CODE_REF before
+ lval_memory.
+
2013-02-14 Pedro Alves <pedro@codesourcery.com>
Hafiz Abid Qadeer <abidh@codesourcery.com>
{
struct type *type = check_typedef (value_type (x));
- if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
- return value_zero (lookup_pointer_type (value_type (x)),
- not_lval);
- else if (TYPE_CODE (type) == TYPE_CODE_REF)
+ if (TYPE_CODE (type) == TYPE_CODE_REF)
return value_zero (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
not_lval);
+ else if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
+ return value_zero (lookup_pointer_type (value_type (x)),
+ not_lval);
else
error (_("Attempt to take address of "
"value not located in memory."));
+2013-02-14 Pedro Alves <palves@redhat.com>
+
+ * gdb.cp/userdef.exp (ptype &*c): Don't expect an &.
+
2013-02-14 Pedro Alves <pedro@codesourcery.com>
Hafiz Abid Qadeer <abidh@codesourcery.com>
gdb_test "print c" "\\\$\[0-9\]* = {m = {z = .*}}"
gdb_test "print *c" "\\\$\[0-9\]* = \\(Member &\\) @$hex: {z = .*}"
gdb_test "print &*c" "\\\$\[0-9\]* = \\(Member \\*\\) $hex"
-gdb_test "ptype &*c" "type = (struct|class) Member {(\[\r\n \]+public:)?\[\r\n \]+int z;\[\r\n\].*} &\\*"
+gdb_test "ptype &*c" "type = (struct|class) Member {(\[\r\n \]+public:)?\[\r\n \]+int z;\[\r\n\].*} \\*"
gdb_test "print operator== (mem1, mem2)" " = false"
gdb_test "print operator== (mem1, mem1)" " = true"