This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/84221, bogus -Wunused with unused attribute on template


On Wed, Apr 4, 2018 at 3:52 PM, Martin Sebor <msebor@gmail.com> wrote:
> On 04/04/2018 01:04 PM, Jason Merrill wrote:
>>
>> For bugs 54372 and 60063, we changed attributes used and unused to be
>> applied immediately in a template even if what they apply to is
>> dependent, to avoid bogus warnings from
>> maybe_warn_unused_local_typedefs.  But that's only an issue for
>> TYPE_DECL, so we can use the normal logic for other things.
>
> In our discussion of attributes I thought we decided that explicit
> specializations would not inherit attributes from the primary.
> IIUC, this change does the opposite for class templates declared
> unused so we end up with an inconsistency with function templates:

I thought about that as well, tested with the explicit specialization
removed, and found that still failed.  So that's the bug I fixed.

We do still warn on the testcase from the PR; I should add that to the
testcase I checked in.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]