This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR symtab/14441 - rvalue references


>>>>> "Jonathan" == Jonathan Wakely <jwakely.gcc@gmail.com> writes:

Jonathan> My first attempt, shown in the attachment, was very simple:
[...]
Jonathan> * adjust c_type_print_varspec_prefix() to print "&&" when type ==
Jonathan> TYPE_RVALUE_REFERENCE_TYPE (TYPE_TARGET_TYPE (type)) i.e. when the
Jonathan> reference being printed is the target type's rvalue_reference_type,
Jonathan> not its reference_type.

The above seems weird to me somehow.
I wonder why it didn't work.
FWIW a flag bit on struct main_type would be ok.

Jonathan> Unfortunately my first attempt at doing that didn't work, so I
Jonathan> started adding TYPE_CODE_RVAL_REF and handling it everywhere
Jonathan> ... but I'm having second thoughts.

Yeah.  That patch would be fairly large.
If you want to persevere, though, I will review it, despite its eventual
size.  But like I said, I think either way is ok.

It seems like the expression parser should at least need one change to
parse the new type, so that "ptype int&&" works.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]