From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20102 invoked by alias); 9 Jan 2013 16:14:55 -0000 Received: (qmail 19988 invoked by uid 22791); 9 Jan 2013 16:14:50 -0000 X-SWARE-Spam-Status: No, hits=-5.3 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-ea0-f172.google.com (HELO mail-ea0-f172.google.com) (209.85.215.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Jan 2013 16:14:45 +0000 Received: by mail-ea0-f172.google.com with SMTP id f13so292130eaa.17 for ; Wed, 09 Jan 2013 08:14:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.216.70 with SMTP id f46mr183996869eep.12.1357748083866; Wed, 09 Jan 2013 08:14:43 -0800 (PST) Received: by 10.14.129.195 with HTTP; Wed, 9 Jan 2013 08:14:43 -0800 (PST) In-Reply-To: <87hamqtlum.fsf@redhat.com> References: <877gnnwzdg.fsf@redhat.com> <87hamqtlum.fsf@redhat.com> Date: Wed, 09 Jan 2013 16:14:00 -0000 Message-ID: Subject: Re: [PATCH] PR c++/55663 - constexpr function templ instantiation considered non-const as alias templ arg 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: 2013-01/txt/msg00491.txt.bz2 On Wed, Jan 9, 2013 at 9:30 AM, Dodji Seketeli wrote: > Gabriel Dos Reis writes: > >> We already have various predicates to test for constant >> expressions so I am uneasy to add yet another one. > > I understand. I got lost in the number of existing predicates to test > for constant expressions, so am I :-) > to the point that I thought (wrongly) the one I wanted wasn't present. :-) > >> I think reduced_constant_expression_p is what you want. > > Thanks. I didn't realize this would work because the comment of > initializer_constant_valid_p (that it uses) says: > > We assume that VALUE has been folded as much as possible > > On a side node, as Jason said in the thread, we might not even need to > touch anything here, as check_instantiated_arg also assumes that its arg > has been fully folded. I guess I'll propose to update the comment of > that function to reflect that assumption. I read your reply. I am now even more puzzled than before. The call to uses_template_parm indicates that we expect that code to work when are also when processing a template (e.g. for non-dependent cases inside a template.) That makes me wonder how it could possibly work for the cases at hand because for non-type template arguments we need full instantiation information to determine convertibility and "constant"ness. -- Gaby