This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] [PR14448] Fold non-dependent initializers in templates (regression)


Giovanni Bajo wrote:

>It appears that the problem is that the initializer of the
>static const variable was never folded correctly because
> it is within a template. I added a call to fold_non_dependent_expr
> at the right spot of the parser.

[snip]

> template<typename T> void foo(T)
> {
>   static const int n=1;
>   A<n+1> a;
> }

Sorry, the testcase I posted is slightly wrong: the variable definition should
have been: "static const int n=1+1;". Otherwise the patch doesn't make much
sense :)

Giovanni Bajo



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]