From patchwork Mon Apr 29 18:50:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 1092795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-499859-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ljD/btsz"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="I8Xnc5bh"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44tDJ53Hxgz9s9T for ; Tue, 30 Apr 2019 04:50:43 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=lq0OD5pBAOYhqkCNNpT6Ko6vh6MJ06LP83DrsfoKT2opIzi+jk ir/0ris/Mbt0V49SVCIkgHl9kECNf+9CcVZQ3LFrHZ7xrpxo7ML9nmaxJXfzFsYQ 3eLJeG3Vwrr2Kh+2K+kkgL6El+bt/Kgs/3CjNqyXggcRKeRFSEIvJg+LM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=9seG2ZKb/ltey/kkZvPRAfFVkqQ=; b=ljD/btszxZhEShpONfS6 sohQJQFyeHcChO6xAeK6Kmq3RaDeDq3hpiCkDvkbMSsY09sDrjjWzTCcZCWxAmok PVqNXrwScXnOWKyoWplQagJRIcp85HPtdigcISEZBs8jSIWyVlaXEhma2Yhfnfms Owzsliw13Ez3hZbb/u+iQJ4= Received: (qmail 43500 invoked by alias); 29 Apr 2019 18:50:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 43490 invoked by uid 89); 29 Apr 2019 18:50:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=H*r:8.14.4, tre, spin X-HELO: userp2130.oracle.com Received: from userp2130.oracle.com (HELO userp2130.oracle.com) (156.151.31.86) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Apr 2019 18:50:34 +0000 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3TIiRZP143363; Mon, 29 Apr 2019 18:50:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : from : subject : message-id : date : mime-version : content-type; s=corp-2018-07-02; bh=SR3osjPdUB4YmW0qwRA/RVhYjzLSiwrZw/NF2It4aD8=; b=I8Xnc5bhnax5hQfi8Xk1qZO/7LCXXB+D0mLOg6up+SNd0h9cl8n2plYYWL2ohk1+Y/r5 IeJaruB00+g4Va5ZyJUO8gPggPi/bCU+d1oSXz0Oz05mrvia3XFUFBvlIrlqs8eZ6bZJ GxgEXyEb1FKxq1MRs3hOFAICMoapO48qoojshXPuD7VHuJt4LJ6pr1pVg1GspGYyHfr2 cwSedN6ZWC81PTFFp6lOJMmN6xETGnL/bB3Q4EM/rCVfbCljVJh7uFwJWbNWLxwbNi44 u1HJi+xElISEtOn/N9/VFxA038BGdKtrSGmBzbuozYA0zzRa/OCJK3g9wAuhkYMTWAD0 Ig== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2s5j5tvydh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Apr 2019 18:50:32 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3TImgD6192007; Mon, 29 Apr 2019 18:50:31 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2s4ew0tua7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Apr 2019 18:50:31 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x3TIoTiP017135; Mon, 29 Apr 2019 18:50:30 GMT Received: from [192.168.1.4] (/79.42.100.192) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 29 Apr 2019 11:50:29 -0700 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch] Avoid some duplicate error messages Message-ID: <03cd0dbc-6e5e-a643-5618-a7b94379298a@oracle.com> Date: Mon, 29 Apr 2019 20:50:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 X-IsSubscribed: yes Hi, I have a small back queue of tweaks of various kinds and sizes, this one seems small enough to be safe wrt last minute release branch fixes. While working on the regression c++/88969, some duplicate errors showed up when we started giving appropriate diagnostics instead of ICEing, which could be cured by unconditionally returning error_mark_node from cp_build_function_call_vec when mark_used fails. In general, in the front-end we have a mix of unconditional and conditional to SFINAE context mark_used checks, I think it's often a delicate choice, the below change passes testing, I would give it a spin, at the beginning of Stage1. Tested x86_64-linux. Thanks, Paolo. //////////////////////// /cp 2019-04-29 Paolo Carlini * typeck.c (cp_build_function_call_vec): When mark_used fails unconditionally return error_mark_node. /testsuite 2019-04-29 Paolo Carlini * g++.dg/cpp2a/multiple-deleted-destroying-delete-error-1.C: New. * g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C: Likewise. Index: cp/typeck.c =================================================================== --- cp/typeck.c (revision 270643) +++ cp/typeck.c (working copy) @@ -3837,7 +3837,7 @@ cp_build_function_call_vec (tree function, vec + +namespace delete_selection_d { + struct B { + void operator delete(void*) = delete; + void operator delete(B *, std::destroying_delete_t) = delete; + }; + void delete_B(B *b) { delete b; } // { dg-bogus "deleted .* deleted" } + // { dg-error "deleted" "" { target c++2a } .-1 } +} Index: testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C =================================================================== --- testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C (nonexistent) +++ testsuite/g++.dg/cpp2a/multiple-deleted-destroying-delete-error-2.C (working copy) @@ -0,0 +1,12 @@ +// { dg-do compile { target c++2a } } + +#include + +namespace delete_selection_r { + struct B { + void operator delete(B *, std::destroying_delete_t) = delete; + void operator delete(void*) = delete; + }; + void delete_B(B *b) { delete b; } // { dg-bogus "deleted .* deleted" } + // { dg-error "deleted" "" { target c++2a } .-1 } +}