From e1cb3213476485a01aa11ecedfa186e386cb4bdb Mon Sep 17 00:00:00 2001 From: Artemiy Volkov Date: Mon, 20 Mar 2017 13:47:48 -0700 Subject: Implement printing of rvalue reference types and values This patch provides the ability to print out names of rvalue reference types and values of those types. This is done in full similarity to regular references, and as with them, we don't print out "const" suffix because all rvalue references are const. gdb/ChangeLog PR gdb/14441 * c-typeprint.c (c_print_type, c_type_print_varspec_prefix) (c_type_print_modifier, c_type_print_varspec_suffix) (c_type_print_base): Support printing rvalue reference types. * c-valprint.c (c_val_print, c_value_print): Support printing rvalue reference values. --- gdb/c-valprint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/c-valprint.c') diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index d29b20ebda9..ab1de5cf9e8 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -541,6 +541,7 @@ c_val_print (struct type *type, break; case TYPE_CODE_REF: + case TYPE_CODE_RVALUE_REF: case TYPE_CODE_ENUM: case TYPE_CODE_FLAGS: case TYPE_CODE_FUNC: @@ -587,8 +588,7 @@ c_value_print (struct value *val, struct ui_file *stream, val_type = value_type (val); type = check_typedef (val_type); - if (TYPE_CODE (type) == TYPE_CODE_PTR - || TYPE_CODE (type) == TYPE_CODE_REF) + if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_IS_REFERENCE (type)) { /* Hack: remove (char *) for char strings. Their type is indicated by the quoted string anyway. -- cgit v1.2.1