This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix some -Wused-but-set-variable regressions (PR c++/82728, PR c++/82799, PR c++/83690)
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 10 Jan 2018 11:59:15 -0500
- Subject: Re: [C++ PATCH] Fix some -Wused-but-set-variable regressions (PR c++/82728, PR c++/82799, PR c++/83690)
- Authentication-results: sourceware.org; auth=none
- References: <20180105221416.GK1833@tucnak> <CADzB+2n4iXwovJxupo9GetwEXA40joNu5+6EbfDeMzc2ddBnDA@mail.gmail.com> <20180110165618.GQ1833@tucnak>
On Wed, Jan 10, 2018 at 11:56 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Jan 10, 2018 at 11:52:16AM -0500, Jason Merrill wrote:
>> On Fri, Jan 5, 2018 at 5:14 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>> > Jason's recent change removed a mark_rvalue_use call from constant_value_1,
>> > which unfortunately regressed quite a few cases where
>> > -Wunused-but-set-variable now has false positives.
>>
>> > The easiest fix seems to be just deal with the -Wunused-but-set-variable
>> > issue at that point.
>>
>> Hmm, we ought to have called mark_rvalue_use before we get here. I'm
>> concerned that these issues indicate that lambda captures won't work
>> in the situations in the testcase, since we rely on mark_rvalue_use to
>> look through them.
>
> Unless you have ideas where to put those mark_rvalue_use calls, I'll defer
> these PRs to you then, this was just an attempt for an easy way out of it
> for the warning. At least the testcases should be usable for future patch.
Makes sense, thanks.
Jason