This is the mail archive of the
mailing list for the GCC project.
Re: [C++ PATCH] Fix constant integral vars with parenthesized initializers in templates (PR c++/36089)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 16 Nov 2008 20:36:50 -0800
- Subject: Re: [C++ PATCH] Fix constant integral vars with parenthesized initializers in templates (PR c++/36089)
- References: <20081110200704.GW3572@tyan-ft48-01.lab.bos.redhat.com>
Jakub Jelinek wrote:
> but can't handle TREE_LIST DECL_INITIAL. Below are two alternative
> patches, the first one teaches integral_constant_value about it,
> the second instead canonicalizes DECL_INITIAL at cp_finish_decl time
> even when processing_template_decl for integral constant vars.
I think the change in constant_value_1 is better. We should try to
preserve the value-initialization vs. direct-initialization distinction
until the point of instantiation; even though it doesn't matter for
scalars, it does matter in general, and it's tidier not to mess it up.
So, the constant_value_1 change is OK.
(650) 331-3385 x713