This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] [C++0x] Support decltype-specifier as start of nested-name-specifier. (Bug 6709)
- From: "Adam Butcher" <dev dot lists at jessamine dot co dot uk>
- To: "Jason Merrill" <jason at redhat dot com>
- Cc: dev dot lists at jessamine dot co dot uk, gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Jul 2011 16:48:03 +0100
- Subject: Re: [Patch] [C++0x] Support decltype-specifier as start of nested-name-specifier. (Bug 6709)
- References: <624bec8afd68f25f6a4f786c268e3701.squirrel@webmail.plus.net> <4D964C5E.9050903@redhat.com>
- Reply-to: dev dot lists at jessamine dot co dot uk
On Fri, April 1, 2011 11:06 pm, Jason Merrill wrote:
> Now that we're in stage 1 again, I'd like to get your decltype changes
> integrated. Sorry I didn't respond sooner.
>
No worries. I'm guilty of not checking mails for months due to other
commitments so didn't see either of your responses (or the committed
fix) on this decltype stuff until now.
> On 01/20/2011 11:51 AM, Adam Butcher wrote:
>>
>> Although this seems to work for many scenarios, the resulting tree
>> seems to be treated as dependent (in the sense of dependent on a
>> template parameter) even when used outside of a template. For
>> instance:
>>
>> struct X {};
>> struct Y { typedef X Inner; enum { E = 7 }; };
>> Y y;
>> decltype(y)::Inner x; // error: 'Inner' does not name a
>> type
>
> It's not that it's treated as dependent; the patch to
> cp_parser_simple_type parses the nested-name-specifier, then discards it
> and doesn't rewind the input stream, so the later call to
> cp_parser_nested_name_specifier doesn't see it and it's as though the
> "decltype(y)::" didn't exist.
>
> I think you want to arrange to skip the lower calls to
> cp_parser_global_scope_opt and cp_parser_nested_name_specifier in this
> case.
>
Thanks for the explanation. Seeing as you've fixed this proper now I'll
have a look at you changeset for info. Cheers for picking this up.
> Do you have tests for your decltype patches?
>
I assume you no longer need these as you've made your own on 176513 right?
Adam