From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62175 invoked by alias); 27 Nov 2017 21:37:52 -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 62157 invoked by uid 89); 27 Nov 2017 21:37:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=7x, CONSTRUCTOR X-HELO: mail-io0-f194.google.com Received: from mail-io0-f194.google.com (HELO mail-io0-f194.google.com) (209.85.223.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Nov 2017 21:37:50 +0000 Received: by mail-io0-f194.google.com with SMTP id h205so37237560iof.5 for ; Mon, 27 Nov 2017 13:37:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=W7kNauRNcdE86Ae/IqbM8gIzXUTB4+LXPAvqABZDIkg=; b=qTO0jGqpqM8gkKjQN5KHIBW4yR3NkGvi4OKkBsS8/tvAwMPQprXF0nat1+QEK6Lz1d w6ghuC2ZlEALpvz0PLBJLVJeBuizC6TWliI6UXvbQeAVKfFAsbS3XytbCtwJjiV9X48T AJbrNnCyqHPKojq3Zzte8ytQK2i2U9KKLZOrdhsw1AR6RIDoEd9Ntj7YrOzdSm7hdgbF FF1mE0xRNrA4ojhCt6Jh+S93uQ2/iduyiszyT4Az5veuhZZdtSt6X+Vzp0pb1MLKeMJp xJkadoh5BRpWghnZ/23dj2vzv3CbxeT4bagbApp5dLZN5100FPk1EKcIfcWURcgNjtk8 AYnw== X-Gm-Message-State: AJaThX4fX+y2L4sLTlROxKOU1Z+jWPgdnDG7al7jQk0yfqkeKlgGDH+j Be3DPm6b/HieL6wE2iTgQWuA8Z04tLqV89JR3BVf9g== X-Google-Smtp-Source: AGs4zMY5VtZEqhcHvknscFPm2LMgnaXXDqQpsWgveqBP2q51OfMPCANjmHZa4KXE/aRddi8rI6QydHBdh8KK556Guyw= X-Received: by 10.107.133.94 with SMTP id h91mr44251284iod.208.1511818669142; Mon, 27 Nov 2017 13:37:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.171.134 with HTTP; Mon, 27 Nov 2017 13:37:28 -0800 (PST) In-Reply-To: <20171123203556.GT14653@tucnak> References: <20171123203556.GT14653@tucnak> From: Jason Merrill Date: Mon, 27 Nov 2017 21:54:00 -0000 Message-ID: Subject: Re: [C++ PATCH] Fix structured binding initializer checking (PR c++/81888) To: Jakub Jelinek Cc: Nathan Sidwell , gcc-patches List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg02332.txt.bz2 On Thu, Nov 23, 2017 at 3:35 PM, Jakub Jelinek wrote: > Hi! > > My PR81258 fix actually rejects even valid cases. > The standard says that: > "The initializer shall be of the form =E2=80=9C=3D assignment-expression= =E2=80=9D, of the form > =E2=80=9C{ assignment-expression }=E2=80=9D, or of the form =E2=80=9C( as= signment-expression )=E2=80=9D > Now, if the form is =3D assigment-expression, we can e.g. in templates en= d up > with CONSTRUCTOR initializer which has more or fewer elements than 1. > > So, this patch restricts the checks to only BRACE_ENCLOSED_INITIALIZER_P > and only if is_direct_init (i.e. not the =3D assignment-expression form). > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk > (and 7.x after a while)? Yes. Jason