This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] consider casts in -Wclass-memaccess (PR c++/81169)
- From: Jason Merrill <jason at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 22 Jun 2017 14:25:50 -0400
- Subject: Re: [PATCH] consider casts in -Wclass-memaccess (PR c++/81169)
- Authentication-results: sourceware.org; auth=none
- References: <9af91072-5751-f37e-37e3-85ffa0df952c@gmail.com>
OK.
On Thu, Jun 22, 2017 at 2:00 PM, Martin Sebor <msebor@gmail.com> wrote:
> By making use of STRIP_NOPS() on the destination of the memory
> function call, besides discarding the (implicit) conversion to
> void* the warning also strips any explicit casts that remove
> cv-qualifiers. This causes warnings that should otherwise be
> suppressed, as pointed out in bug 81169.
>
> The attached patch only strips the outermost NOP_EXPR's to avoid
> the unexpected warning in these cases.
>
> Martin