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] Fix constant integral vars with parenthesized initializers in templates (PR c++/36089)


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


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