This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] [PR14448] Fold non-dependent initializers in templates (regression)
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: "Mark Mitchell" <mark at codesourcery dot com>
- Date: Mon, 8 Mar 2004 03:44:56 +0100
- Subject: 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