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: [RFC] Add UNARY_PLUS_EXPR to C++ front-end


Mark Mitchell <mark@codesourcery.com> 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:
http://gcc.gnu.org/ml/gcc-patches/2005-05/msg02472.html

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.
-- 
Giovanni Bajo


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