[C++ PATCH] Fix constant integral vars with parenthesized initializers in templates (PR c++/36089)

Mark Mitchell mark@codesourcery.com
Mon Nov 17 05:19:00 GMT 2008


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.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list