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?  That is,
>
> void *p;
> void f(void) { +p; }
>
> is valid C++ (but not valid C), while
>
> int n;
> void f(void) { +n = 0; }
>
> is invalid as both C and C++.

Meanwhile, I have committed the attached patch which adds these two testcases
so that I do not forget about it.

Giovanni Bajo

Attachment: patch-unary-tests.txt
Description: Text document


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