From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109139 invoked by alias); 24 May 2017 06:49:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 92526 invoked by uid 89); 24 May 2017 06:48:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=10PM, 10pm, H*i:sk:xK59bLY, H*i:2ngQA X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 May 2017 06:48:57 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9DB2361B8D for ; Wed, 24 May 2017 06:48:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9DB2361B8D Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9DB2361B8D Received: from tucnak.zalov.cz (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E8DC7BCBB; Wed, 24 May 2017 06:48:58 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v4O6mtXm031348; Wed, 24 May 2017 08:48:55 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v4O6mr1u031347; Wed, 24 May 2017 08:48:53 +0200 Date: Wed, 24 May 2017 06:52:00 -0000 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches List Subject: Re: C++ PATCH to -Wunused with C++17 structured bindings Message-ID: <20170524064853.GY8499@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01820.txt.bz2 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. > > Tested x86_64-pc-linux-gnu, applying to trunk. 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? Jakub