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