This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to forbid use of bool with the ++ operator
- From: Jason Merrill <jason at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 13 Sep 2016 23:37:20 -0400
- Subject: Re: C++ PATCH to forbid use of bool with the ++ operator
- Authentication-results: sourceware.org; auth=none
- References: <20160913183633.GO19950@redhat.com> <57D859CC.8020001@gmail.com>
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