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++ PATCH] [PR18354] Unary plus as template argument


Joseph S. Myers <joseph@codesourcery.com> wrote:

> Does your patch preserve the properties that (a) C++, unlike C,
> permits the operand of unary plus, but not unary minus, to have pointer type,
> (b) the result of unary plus is not an lvalue?

No, both are broken by my patch, and there are no testcases for this in the
testsuite. (a) is easily fixed by restoring the missing WANT_POINTER in the
call to build_expr_type_conversion (I did not know about this C++ rule, but I
should have been more careful).

As for (b), I accept suggestions about how to fix it without reintroducing
NON_LVALUE_EXPR. Otherwise, I will have to just strip that code in
convert_nontype_argument to avoid the failure.

Patch is withdrawn meanwhile, many thanks Joseph for catching this!

Giovanni Bajo


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