This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/66543 (-Wunused-but-set false positives)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Apr 2016 21:49:30 +0200
- Subject: Re: C++ PATCH for c++/66543 (-Wunused-but-set false positives)
- Authentication-results: sourceware.org; auth=none
- References: <5716870D dot 2030709 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Apr 19, 2016 at 03:29:17PM -0400, Jason Merrill wrote:
> We've been seeing false positives from these warnings in template code due
> to uses not making it through into the instantiation:
>
> 1) If a pack expansion has no elements
> 2) If a parameter used in a trailing-return-type is instantiated into a
> dummy distinct from the real instantiation
> 3) If a generic lambda that refers to the decl is never instantiated
>
> Tested x86_64-pc-linux-gnu, applying to trunk.
Looks safe even for 6.1 to me, or if you want to give it more time on trunk,
at least for 6.2. But we'll do a rc2 later this week in any case.
> commit 16a145d52dcd75c5da6702ca7024a4570abf6d36
> Author: Jason Merrill <jason@redhat.com>
> Date: Wed Mar 2 09:40:14 2016 -0500
>
> PR c++/66543 - -Wunused-but-set* false positives
>
> * expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
> * pt.c (make_pack_expansion): Call mark_exp_read.
> * semantics.c (finish_id_expression): Call mark_type_use in
> unevaluated context.
Jakub