2017-03-20 Artemiy Volkov <artemiyv@acm.org>
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.
+
+2017-03-20 Artemiy Volkov <artemiyv@acm.org>
+
+ PR gdb/14441
* cp-name-parser.y (ptr_operator): Handle the '&&' token in
typename.
* cp-support.c (replace_typedefs): Handle
&& !TYPE_VECTOR (type))
|| code == TYPE_CODE_MEMBERPTR
|| code == TYPE_CODE_METHODPTR
- || code == TYPE_CODE_REF)))
+ || TYPE_IS_REFERENCE (type))))
fputs_filtered (" ", stream);
need_post_space = (varstring != NULL && strcmp (varstring, "") != 0);
c_type_print_varspec_prefix (type, stream, show, 0, need_post_space,
break;
case TYPE_CODE_REF:
+ case TYPE_CODE_RVALUE_REF:
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
stream, show, 1, 0, flags);
- fprintf_filtered (stream, "&");
+ fprintf_filtered (stream, TYPE_CODE(type) == TYPE_CODE_REF ? "&" : "&&");
c_type_print_modifier (type, stream, 1, need_post_space);
break;
/* We don't print `const' qualifiers for references --- since all
operators affect the thing referenced, not the reference itself,
every reference is `const'. */
- if (TYPE_CONST (type)
- && TYPE_CODE (type) != TYPE_CODE_REF)
+ if (TYPE_CONST (type) && !TYPE_IS_REFERENCE (type))
{
if (need_pre_space)
fprintf_filtered (stream, " ");
case TYPE_CODE_PTR:
case TYPE_CODE_REF:
+ case TYPE_CODE_RVALUE_REF:
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream,
show, 1, 0, flags);
break;
case TYPE_CODE_PTR:
case TYPE_CODE_MEMBERPTR:
case TYPE_CODE_REF:
+ case TYPE_CODE_RVALUE_REF:
case TYPE_CODE_FUNC:
case TYPE_CODE_METHOD:
case TYPE_CODE_METHODPTR:
break;
case TYPE_CODE_REF:
+ case TYPE_CODE_RVALUE_REF:
case TYPE_CODE_ENUM:
case TYPE_CODE_FLAGS:
case TYPE_CODE_FUNC:
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.