This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Add UNARY_PLUS_EXPR to C++ front-end
Mark Mitchell <firstname.lastname@example.org> wrote:
> I would have expected the fold_non_dependent_expr call in
> convert_nontype_argument to take care of that. It should eventually
> call build_x_unary_op (UNARY_PLUS_EXPR, ...), and then that should fold
> things away. Would you look down that path and see what's going wrong?
Yes, but build_x_unary_op calls fold_non_dependent_expr, which in turns just
calls fold. fold() was able to strip CONVERT_EXPR from the INTEGER_CST, but
it does not know about UNARY_PLUS_EXPR. Instead of teaching fold() abou
UNARY_PLUS_EXPR, I suggested patching fold_non_dependent_expr while we are
waiting someone to implement our beloved cxx_fold(). See my suggestion here:
Do you agree on this?
> The rest of the patch looks sensible enough, at first blush, but I've
> not done a thorough read-through yet.
FWIW, it looks OK to me.