This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c++/55663 - constexpr function templ instantiation considered non-const as alias templ arg
- From: Dodji Seketeli <dodji at redhat dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Wed, 09 Jan 2013 16:30:41 +0100
- Subject: Re: [PATCH] PR c++/55663 - constexpr function templ instantiation considered non-const as alias templ arg
- References: <877gnnwzdg.fsf@redhat.com> <CAAiZkiCPPTmoXZnJTZ+MMAB5tmwEQut7vKZR=+KTb3ckZTHKhQ@mail.gmail.com>
Gabriel Dos Reis <gdr@integrable-solutions.net> 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, 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.
Thanks.
--
Dodji