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 to forbid use of bool with the ++ operator


On Tue, Sep 13, 2016 at 3:55 PM, Martin Sebor <msebor@gmail.com> wrote:
> Having said all that, since this is C++ the message could and
> arguably should refer to a bool expression (or type) instead
> and avoid having to deal with this altogether. In fact, it
> would be simpler to rephrase the message as:
>
>   "use of an operand of type %qT in ... is deprecated",
>   boolean_type_node

Yes.

> As a separate issue, the message hardcodes operator++ but
> the comment farther above says:
>
>    Forbid using -- or ++ in C++17 on `bool'
>
> Should it be parameterized on the kind expression and both
> expressions tested?

The code immediately above the addition handles --.

Jason


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