This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Support C++11 rvalue (move constructor)
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Date: Mon, 14 Oct 2013 10:10:20 -0600
- Subject: Re: [patch] Support C++11 rvalue (move constructor)
- Authentication-results: sourceware.org; auth=none
- References: <20131012152836 dot GA9438 at host2 dot jankratochvil dot net>
CCing Jonathan Wakely.
Jan> currently one cannot debug C++11 move constructors, one gets:
This is PR 14441. Also see the thread:
https://sourceware.org/ml/gdb/2012-10/msg00108.html
I think Jonathan started a branch for this...
Jan> Therefore there is a KFAIL in the testcase for it. I do not think
Jan> GDB needs to handle && differently - except for displaying &&
Jan> instead of &.
Is that also true for inferior calls?
I didn't look.
Jan> or to add new main_type::flag_ref_is_rvalue valid only for
Jan> TYPE_CODE_REF but that is sure not a clean implementation.
If the semantics of the two kinds of references are sufficiently
similar, then I don't think it is actually so bad.
Jan> (2) One would need to add type.rvalue_reference_type (besides
Jan> type.reference_type) to prevent leaks of types. This would mean
Jan> increasing the current sizeof (struct type) 40 -> 48. The proper
Jan> solution is to rather implement reference counting or garbage
Jan> collecting of types and merge struct type into struct main_type.
Maybe the size increase isn't that important.
Alternatively maybe it can be handled like qualifiers.
Jan> Anyway currently I find the patch below as a good enough hack as currently
Jan> I find it a bit blocker when using C++11.
It seems reasonable to me -- an improvement, and not blocking any future
improvements.
Tom