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
On Wed, Jan 9, 2013 at 9:30 AM, Dodji Seketeli <dodji@redhat.com> wrote:
> 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,
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