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++0x patch] constexpr in attribute argument


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


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