+2012-12-06 Pedro Alves <palves@redhat.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * valops.c (value_cast): Move TYPE_CODE_VOID case earlier.
+
2012-12-06 Jens Elmenthaler <jens.elmenthaler@advantest.com>
PR mi/14741:
+2012-12-06 Pedro Alves <palves@redhat.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/exprs.exp: Add tests for cast to void.
+
2012-12-06 Jens Elmenthaler <jens.elmenthaler@advantest.com>
* gdb.python/py-mi.exp: Correct expected results for attribute
# gdb's {} extension
gdb_test_no_output "set variable v_short_array\[0\] = 42"
gdb_test "print {short} v_short_array" "$decimal = 42"
+
+# Regression tests for cast to void.
+gdb_test "print (void) v_int_pointer" " = void"
+gdb_test "print & (void) v_char" "value not located in memory."
}
return val;
}
+ else if (code1 == TYPE_CODE_VOID)
+ {
+ return value_zero (type, not_lval);
+ }
else if (TYPE_LENGTH (type) == TYPE_LENGTH (type2))
{
if (code1 == TYPE_CODE_PTR && code2 == TYPE_CODE_PTR)
}
else if (VALUE_LVAL (arg2) == lval_memory)
return value_at_lazy (type, value_address (arg2));
- else if (code1 == TYPE_CODE_VOID)
- {
- return value_zero (type, not_lval);
- }
else
{
error (_("Invalid cast."));