This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Add UNARY_PLUS_EXPR to C++ front-end
- From: "Giovanni Bajo" <rasky at develer dot com>
- To: "Mark Mitchell" <mark at codesourcery dot com>
- Cc: "Roger Sayle" <roger at eyesopen dot com>,<gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 May 2005 22:14:40 +0200
- Subject: Re: [RFC] Add UNARY_PLUS_EXPR to C++ front-end
Sorry for the confusion, but I really meant fold_if_not_in_template()
instead of fold_non_dependent_expr() in the previous mail. So, this is how
it should have been:
>> 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_if_not_in_template(), 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_if_not_in_template(), 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?
--
Giovanni Bajo