This is the mail archive of the
mailing list for the GCC project.
Re: [C++ PATCH] [PR18354] Unary plus as template argument
Joseph S. Myers <firstname.lastname@example.org> 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!