[C++0x patch] constexpr in attribute argument

Jason Merrill jason@redhat.com
Fri Mar 11 15:58:00 GMT 2011


On 03/11/2011 04:33 AM, Rodrigo Rivas wrote:
> On Fri, Mar 11, 2011 at 6:51 AM, Jason Merrill<jason@redhat.com>  wrote:
>> How about just calling maybe_constant_value call after the
>> fold_non_dependent_expr call in cp_parser_parenthesized_expression_list?
>
> Well, I first tried something like this, but the key problem is the
> *non_dependent* part, so it does nothing if the expression involves
> templates:

Ah, yes, you would also need to call it in apply_late_template_attributes.

> BTW, a general question, why isn't there a call to
> maybe_constant_value just at the end of fold_non_dependent_expr?

I tried combining the two functions at one point but it didn't work so 
well.  It might make sense to try again, though.

The problem is that we don't want to call fold_non_dependent_expr on an 
expression that has already been folded, but it's fine to repeat 
maybe_constant_value.

> My patch calls maybe_constant_value after taking away any dependent
> expression (cplus_decl_attributes does all the job).

Sure, I guess calling it in one place is better.  But I think let's wait 
until 4.6.1 for this patch.

Jason



More information about the Gcc-patches mailing list