This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch][libstdc++ patch][c++ patch] Update mangling and demangling for rvalue references
- From: Ian Lance Taylor <iant at google dot com>
- To: "Doug Gregor" <doug dot gregor at gmail dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: 29 Jun 2007 17:16:38 -0700
- Subject: Re: [patch][libstdc++ patch][c++ patch] Update mangling and demangling for rvalue references
- References: <24b520d20706291239m4fc7d82bme5d74b3e4a774ee7@mail.gmail.com>
"Doug Gregor" <doug.gregor@gmail.com> writes:
> Index: include/demangle.h
> ===================================================================
> --- include/demangle.h (revision 126081)
> +++ include/demangle.h (working copy)
> @@ -359,7 +359,10 @@ enum demangle_component_type
> using 'n' instead of '-', we want a way to indicate a negative
> number which involves neither modifying the mangled string nor
> allocating a new copy of the literal in memory. */
> - DEMANGLE_COMPONENT_LITERAL_NEG
> + DEMANGLE_COMPONENT_LITERAL_NEG,
> + /* C++0x: An rvalue reference. The one subtree is the type which is
> + being referenced. */
> + DEMANGLE_COMPONENT_RVALUE_REFERENCE
> };
Please put this up just after DEMANGLE_COMPONENT_REFERENCE.
> Index: libiberty/cp-demangle.c
> ===================================================================
> --- libiberty/cp-demangle.c (revision 126081)
> +++ libiberty/cp-demangle.c (working copy)
> @@ -1726,6 +1730,7 @@ d_ctor_dtor_name (struct d_info *di)
> ::= <CV-qualifiers> <type>
> ::= P <type>
> ::= R <type>
> + ::= RR <type> (C++0x)
> ::= C <type>
> ::= G <type>
> ::= U <source-name> <type>
I think you mean O here, not RR.
> @@ -1901,7 +1912,7 @@ cplus_demangle_type (struct d_info *di)
> case 'R':
> d_advance (di, 1);
> ret = d_make_comp (di, DEMANGLE_COMPONENT_REFERENCE,
> - cplus_demangle_type (di), NULL);
> + cplus_demangle_type (di), NULL);
> break;
>
> case 'C':
This is only a whitespace change, I assume.
As far as I'm concerned, this patch is OK with those changes. But get
one of the C++ maintainers to approve the basic approach first.
Thanks.
Ian