From patchwork Fri Mar 10 18:49:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1755513 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=LULYoUWO; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PYFV435mgz1yWp for ; Sat, 11 Mar 2023 05:50:04 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6053A3858C20 for ; Fri, 10 Mar 2023 18:50:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6053A3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678474202; bh=iaQI5k3IR68YEdqXUW+ue1S9WqAIvCN5kiaf4HpF5PM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=LULYoUWO1fH67G0TttPJTLw2zXEzarV2t00hmjD0D4RnvX8ZNcogcu45hcuZ04SN+ 3h1+bz4nXAW8AmIRVDf4rjRF/XetiHPKh142kD7graMT29pTdQq6hdjv4V1MHA/rt3 P3Z3NxCAmkSXB4IJz3lo/lNBEBPi8PLgKCOOfV3s= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2B9C13858D38 for ; Fri, 10 Mar 2023 18:49:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2B9C13858D38 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-568-nC1D3c7gOaOiuLOo0mJEyg-1; Fri, 10 Mar 2023 13:49:42 -0500 X-MC-Unique: nC1D3c7gOaOiuLOo0mJEyg-1 Received: by mail-qt1-f199.google.com with SMTP id x21-20020ac86b55000000b003c01d1a0708so3384977qts.19 for ; Fri, 10 Mar 2023 10:49:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678474182; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iaQI5k3IR68YEdqXUW+ue1S9WqAIvCN5kiaf4HpF5PM=; b=HxgpHHxIZw/uifPU/T8S2uoL7gY2rmPdoHJKWeLxSKP9ixHHetVZlQ+z73aBloLPTe DQbrOCxRjZB0tLid98C7fOneYicR8gVs1YMyGQVPURVvxT7ZFoEiYt/vo7iXYBPATNS3 cfm1dxrGFcFZVarNdO693+l3cMKakibOFjkFmPlnfazeiBjYSZlvq14fgNNWyEKQ5WwR uz3YAPAZfK4wfyPweIzRS9XKaf786QDtJyT5KiOZ6OJ3FC6B8SngOKLaEYWA3J108tBu eZUUE/PdNYFoNi50etb1uzBstHycZ3CGP2ChqJa0WI5l5ZskNwIXFscUCHQuHbgrBZhY BO3w== X-Gm-Message-State: AO0yUKUOjZkAoKB5H8MbgFJxrzlg4HCSmfUPLlLLne4qGjlOP6pwGZ3k JwCHAWWB+8r05qwa9C13HicCJ+ub10ALcZJPTuwNA6cdDIz/POaU6TvCZW/w4D5yvcYULgMDrFB blu4/G/BcSehw6ukUYULdd99VGNEtM6Npk7VRZtL5DolTGwSH2KkKeHR9K1A5JoKOGoHSKkJ35g == X-Received: by 2002:a05:622a:1106:b0:3ba:36f2:c207 with SMTP id e6-20020a05622a110600b003ba36f2c207mr47979573qty.39.1678474181839; Fri, 10 Mar 2023 10:49:41 -0800 (PST) X-Google-Smtp-Source: AK7set90A/dzBkLr3WOzB6XxNSFx6EYu8sp/6W9ptlUkWsSn5HjAGvLpvPEVdgxuROmwj8w7Ss0NPg== X-Received: by 2002:a05:622a:1106:b0:3ba:36f2:c207 with SMTP id e6-20020a05622a110600b003ba36f2c207mr47979541qty.39.1678474181478; Fri, 10 Mar 2023 10:49:41 -0800 (PST) Received: from jason.cygnus.csb (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id w20-20020ae9e514000000b0073b99d515e2sm299322qkf.44.2023.03.10.10.49.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 10:49:40 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: constrained lambda error-recovery [PR108972] Date: Fri, 10 Mar 2023 13:49:38 -0500 Message-Id: <20230310184938.2531120-1-jason@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jason Merrill via Gcc-patches From: Jason Merrill Reply-To: Jason Merrill Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Better not to ICE after various valid errors. PR c++/108972 gcc/cp/ChangeLog: * lambda.cc (compare_lambda_template_head): Check more for error_mark_node. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-lambda3.C: Run at lower std levels, but expect errors. --- gcc/cp/lambda.cc | 4 ++++ gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) base-commit: e1c8cf9006bd278e969ab7ed35178067ce128f32 diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc index c752622816d..212990a21bf 100644 --- a/gcc/cp/lambda.cc +++ b/gcc/cp/lambda.cc @@ -1537,6 +1537,8 @@ compare_lambda_template_head (tree tmpl_a, tree tmpl_b) if (parm_a == error_mark_node) return false; parm_a = TREE_VALUE (parm_a); + if (parm_a == error_mark_node) + return false; if (DECL_VIRTUAL_P (parm_a)) parm_a = NULL_TREE; } @@ -1548,6 +1550,8 @@ compare_lambda_template_head (tree tmpl_a, tree tmpl_b) if (parm_b == error_mark_node) return false; parm_b = TREE_VALUE (parm_b); + if (parm_b == error_mark_node) + return false; if (DECL_VIRTUAL_P (parm_b)) parm_b = NULL_TREE; } diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C index 291e451ca1a..b18e6b62aa4 100644 --- a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda3.C @@ -1,4 +1,5 @@ -// { dg-do run { target c++20 } } +// { dg-do run } +// { dg-excess-errors "" { target { ! concepts } } } (PR108972) template concept C1 = __is_same_as(T, int) @@ -61,4 +62,3 @@ int main(int, char**) return 0; } -