Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-03-21 Thread Martin Sebor
I'm not 100% sure I understand what changes you're suggesting but the attached patch does what I think you're after. Is that what you had in mind? Looks good. Thanks. I just committed it to trunk but forgot to ask for approval to backport it to 6 and 5. Martin

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-03-21 Thread Jason Merrill
On Tue, Mar 21, 2017 at 2:40 PM, Martin Sebor wrote: > On 03/20/2017 03:11 PM, Jason Merrill wrote: >> >> On Thu, Feb 23, 2017 at 6:33 PM, Jason Merrill wrote: >>> >>> On Thu, Feb 23, 2017 at 12:56 PM, Martin Sebor wrote: On

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-03-21 Thread Martin Sebor
On 03/20/2017 03:11 PM, Jason Merrill wrote: On Thu, Feb 23, 2017 at 6:33 PM, Jason Merrill wrote: On Thu, Feb 23, 2017 at 12:56 PM, Martin Sebor wrote: On 02/22/2017 05:43 PM, Jason Merrill wrote: On Wed, Feb 22, 2017 at 3:44 PM, Martin Sebor

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-03-20 Thread Jason Merrill
On Thu, Feb 23, 2017 at 6:33 PM, Jason Merrill wrote: > On Thu, Feb 23, 2017 at 12:56 PM, Martin Sebor wrote: >> On 02/22/2017 05:43 PM, Jason Merrill wrote: >>> On Wed, Feb 22, 2017 at 3:44 PM, Martin Sebor wrote: On 02/22/2017 11:02

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-23 Thread Jason Merrill
On Thu, Feb 23, 2017 at 12:56 PM, Martin Sebor wrote: > On 02/22/2017 05:43 PM, Jason Merrill wrote: >> On Wed, Feb 22, 2017 at 3:44 PM, Martin Sebor wrote: >>> On 02/22/2017 11:02 AM, Jason Merrill wrote: >>> The TREE_USED bit on the type (i.e., on >>>

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-23 Thread Martin Sebor
On 02/22/2017 05:43 PM, Jason Merrill wrote: On Wed, Feb 22, 2017 at 3:44 PM, Martin Sebor wrote: On 02/22/2017 11:02 AM, Jason Merrill wrote: On Tue, Feb 21, 2017 at 4:27 PM, Martin Sebor wrote: Ah, I see, your patch changes attribute unused handling

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-22 Thread Jason Merrill
On Wed, Feb 22, 2017 at 3:44 PM, Martin Sebor wrote: > On 02/22/2017 11:02 AM, Jason Merrill wrote: >> >> On Tue, Feb 21, 2017 at 4:27 PM, Martin Sebor wrote: Ah, I see, your patch changes attribute unused handling for local variables from

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-22 Thread Martin Sebor
On 02/22/2017 11:02 AM, Jason Merrill wrote: On Tue, Feb 21, 2017 at 4:27 PM, Martin Sebor wrote: Ah, I see, your patch changes attribute unused handling for local variables from tracking TREE_USED to lookup_attribute. I'm not opposed to this change, but I'd like to

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-22 Thread Jason Merrill
On Tue, Feb 21, 2017 at 4:27 PM, Martin Sebor wrote: >> Ah, I see, your patch changes attribute unused handling for local >> variables from tracking TREE_USED to lookup_attribute. I'm not >> opposed to this change, but I'd like to understand why the TREE_USED >> handling wasn't

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-21 Thread Martin Sebor
Ah, I see, your patch changes attribute unused handling for local variables from tracking TREE_USED to lookup_attribute. I'm not opposed to this change, but I'd like to understand why the TREE_USED handling wasn't working. In the test case in the bug: template void g () { T t; //

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-21 Thread Jason Merrill
On Tue, Feb 21, 2017 at 11:00 AM, Martin Sebor wrote: > On 02/21/2017 11:08 AM, Jason Merrill wrote: >> >> On 02/17/2017 05:07 PM, Martin Sebor wrote: >>> >>> * decl.c (poplevel): Avoid diagnosing entities declared with >>> attribute unused. >> >> >> This change is OK.

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-21 Thread Martin Sebor
On 02/21/2017 11:08 AM, Jason Merrill wrote: On 02/17/2017 05:07 PM, Martin Sebor wrote: * decl.c (poplevel): Avoid diagnosing entities declared with attribute unused. This change is OK. (initialize_local_var): Do not consider the type of a variable when determining whether

Re: [PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-21 Thread Jason Merrill
On 02/17/2017 05:07 PM, Martin Sebor wrote: * decl.c (poplevel): Avoid diagnosing entities declared with attribute unused. This change is OK. (initialize_local_var): Do not consider the type of a variable when determining whether or not it's used. This is

[PATCH] restore -Wunused-variable on a typedef'd variable in a function template (PR 79548)

2017-02-17 Thread Martin Sebor
The attached patch fixes bug 79548 - [5/6/7 Regression] missing -Wunused-variable on a typedef'd variable in a function template, most likely broken by the introduction of -Wunused-local-typedefs. While testing the patch I came across a couple of other bugs: 79585 - spurious -Wunused-variable