public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH to -Wunused with C++17 structured bindings
Date: Wed, 24 May 2017 16:19:00 -0000	[thread overview]
Message-ID: <CADzB+2=Lshw_WbyqYxYDSaVrGj4CSmen5C4y4FqASR6mUHs-eg@mail.gmail.com> (raw)
In-Reply-To: <20170524064853.GY8499@tucnak>

On Wed, May 24, 2017 at 2:48 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, May 23, 2017 at 09:45:10PM -0400, Jason Merrill wrote:
>> Someone on IRC complained that there was no way to suppress -Wunused
>> on structured bindings.  It seemed to me that the way the feature
>> works, we shouldn't warn about the bindings individually; users need
>> to give each of the subobjects a name even if they're only interested
>> in using one of them.
>>
>> So this patch switches to tracking whether the underlying aggregate
>> object as a whole is used; using one of the bindings will avoid any
>> warning.
>>
>> This doesn't apply to tuple structured bindings, since in that case
>> the bindings are actual variables rather than aliases to subobjects.
>
> So, shall we have even for the tuple structured bindings somewhere (in
> lang_decl, such as adding struct lang_decl_decomp that would include
> lang_decl_min?) the tree for the underlying artificial var decl?

That would make sense.

Jason

  reply	other threads:[~2017-05-24 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24  2:23 Jason Merrill
2017-05-24  6:52 ` Jakub Jelinek
2017-05-24 16:19   ` Jason Merrill [this message]
2017-05-25 14:23     ` [C++ PATCH] Fix " Jakub Jelinek
2017-05-25 19:08       ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADzB+2=Lshw_WbyqYxYDSaVrGj4CSmen5C4y4FqASR6mUHs-eg@mail.gmail.com' \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).