[C++ PATCH] (regression) Set TREE_CONSTANT for STATIC_EXPR and CAST_EXPR
Giovanni Bajo
giovannibajo@libero.it
Fri Jun 20 01:00:00 GMT 2003
Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
>> Au contraire!
>>
>> They can be checked whenever we want to check them, and early is good.
>
> In processing
>
> template<class Q>
> struct X {
> typedef typename Q::T T;
> static const T a = Q::a;
> };
>
> there is no way of knowing whether Q::a is a valid initializer.
But Q::a is dependent. Mark is saying that we should try and check any
non-dependent expression at parsing time, and postpone semantic checks of
dependent expressions only at instantiation point. That is, enforcing most
of the if (processing_template_decl) checks with a proper is_dependent
check.
Giovanni Bajo
More information about the Gcc-patches
mailing list