From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23103 invoked by alias); 22 Dec 2012 16:43:00 -0000 Received: (qmail 23093 invoked by uid 22791); 22 Dec 2012 16:42:57 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ee0-f46.google.com (HELO mail-ee0-f46.google.com) (74.125.83.46) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 22 Dec 2012 16:42:52 +0000 Received: by mail-ee0-f46.google.com with SMTP id e53so2901540eek.5 for ; Sat, 22 Dec 2012 08:42:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.207.6 with SMTP id m6mr41349502eeo.10.1356194571558; Sat, 22 Dec 2012 08:42:51 -0800 (PST) Received: by 10.14.216.6 with HTTP; Sat, 22 Dec 2012 08:42:51 -0800 (PST) In-Reply-To: <87zk16hymj.fsf@redhat.com> References: <87a9t74m7m.fsf@redhat.com> <8738yz4bk6.fsf@redhat.com> <87zk16hymj.fsf@redhat.com> Date: Sat, 22 Dec 2012 16:43:00 -0000 Message-ID: Subject: Re: [PATCH] PR c++/52343 - error with alias template as template template argument From: Gabriel Dos Reis To: Dodji Seketeli Cc: GCC Patches , Jason Merrill Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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: 2012-12/txt/msg01362.txt.bz2 On Sat, Dec 22, 2012 at 9:53 AM, Dodji Seketeli wrote: > Gabriel Dos Reis writes: > >> Thank you very much for the explanation; your previous message >> makes sense to me now. > > You are welcome. > >> The question I have is why are we using TREE_TYPE of a TEMPLATE_DECL >> to represent the current instantiation of a template alias? > > My understanding is that in the instantiation at line 7 below > > 1 template > 2 using A = int; > 3 > 4 template class> > 5 struct B {}; > 6 > 7 B b; > > check_instantiated_arg is not looking at the current instantiation of > the template alias A. Rather, it is looking at the template-name A > (which resolved, IMHO rightfully, to the decl for A which happens to be > a TEMPLATE_DECL). This seems consistent with the fact that the > parameter of B is a template itself so its argument ought to be > template-name, rather than a template instantiation. Sorry for the confusion, "current instantiation" was the wrong word. What I meant to say was that the use and interpretation of TREE_TYPE is very confusing in this context. -- Gaby