From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12443 invoked by alias); 21 Jul 2011 15:48:22 -0000 Received: (qmail 12434 invoked by uid 22791); 21 Jul 2011 15:48:21 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from relay.ptn-ipout02.plus.net (HELO relay.ptn-ipout02.plus.net) (212.159.7.36) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jul 2011 15:48:07 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAGFJKE7Unw4R/2dsb2JhbABUp0B3iHwCu3WGPgSXdYtX Received: from outmx02.plus.net ([212.159.14.17]) by relay.ptn-ipout02.plus.net with ESMTP; 21 Jul 2011 16:48:05 +0100 Received: from [212.159.8.87] (helo=pih-webmail04) by outmx02.plus.net with esmtp (Exim) id 1QjvTp-000777-8T; Thu, 21 Jul 2011 16:48:05 +0100 Received: from localhost ([127.0.0.1] helo=webmail.plus.net) by pih-webmail04 with esmtp (Exim 4.63) (envelope-from ) id 1QjvTn-0008DX-PS; Thu, 21 Jul 2011 16:48:04 +0100 Received: from 194.201.250.209 (SquirrelMail authenticated user jessaminenet+dev.lists) by webmail.plus.net with HTTP; Thu, 21 Jul 2011 16:48:03 +0100 Message-ID: <87d4746917f86a0951d46fcfd5e361e9.squirrel@webmail.plus.net> In-Reply-To: <4D964C5E.9050903@redhat.com> References: <624bec8afd68f25f6a4f786c268e3701.squirrel@webmail.plus.net> <4D964C5E.9050903@redhat.com> Date: Thu, 21 Jul 2011 15:59:00 -0000 Subject: Re: [Patch] [C++0x] Support decltype-specifier as start of nested-name-specifier. (Bug 6709) From: "Adam Butcher" To: "Jason Merrill" Cc: dev.lists@jessamine.co.uk, gcc-patches@gcc.gnu.org Reply-To: dev.lists@jessamine.co.uk User-Agent: SquirrelMail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-07/txt/msg01790.txt.bz2 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