This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Add UNARY_PLUS_EXPR to C++ front-end
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 May 2005 11:32:01 -0700
- Subject: Re: [RFC] Add UNARY_PLUS_EXPR to C++ front-end
- References: <Pine.LNX.firstname.lastname@example.org>
Roger Sayle wrote:
The following is a request for comment, or more accurately a request
for help, from the C++ folks for a patch to introduce a new front-end
tree code for C++'s unary plus operator.
FAIL: g++.dg/template/nontype11.C (test for excess errors)
which fails due to the error message:
nontype11.C:14: error: '+1' is not a valid template argument for type
'int' because it is a non-constant expression
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?
The rest of the patch looks sensible enough, at first blush, but I've
not done a thorough read-through yet.