Message ID | 20231213164740.1591535-3-jason@redhat.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7911394dys; Wed, 13 Dec 2023 08:48:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcWdm6+y3PM/vXWD9s41xyh0vqvBaLdvp8d+VmeOYGoJOoXa1aYWCPApNO3wjFruGirJRe X-Received: by 2002:ac8:5703:0:b0:425:9330:a928 with SMTP id 3-20020ac85703000000b004259330a928mr11243700qtw.108.1702486122149; Wed, 13 Dec 2023 08:48:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702486122; cv=pass; d=google.com; s=arc-20160816; b=bJrmfJFNLEtTuK4PzraPdxeMWvFX1mOczLs0d7G1YHIozlNaITy/19Ae1FZVKcNWPk fcM4UroluIKVJMUFGd/F7FMTlLDARRYRIM1rAYUOtb7FTQxbXAa6lTFubwOw/Gl6T68l UMK5qvf55/aLAxPf6oV6G6mHpzyB+p+0zxTdsZG1drmbGTfdva6A0Gqad8aMuO2+urtY NgF/MvqfeuCWXTnfUsYQnxss7iaGpIZ3yQB85w81/pWrYH+faoTwaW9zDz+ZwxK8QZkW wfO8tN22LHIQ0b7c7JXaBxcSLpux3A9SsHxaQQDRfmzJM/CtENjLFwf5eII4EhOjz5+o /G+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=uOsEPe1ZWRgKAULfx7WismIE7BcIIpo1SkPFjoXy9rc=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=MJZeAdH8fQ6h7WKmtlAlT+6cqHYUDFyy0Aka0iwip5jEt4bGRaHTr+YvRgFg9s5/qx 6zTaYuPl8W0RqKEEGW7lcxMrEW1lVi1mqA9lIgIDLX+EB1uEVWEJ7Z4My49LdLKanLMx FWxp+QZhJlm/6KVa78JFt8b+/WIOYrmjg0R4UKtU6DB4vpcdM0UNqNWEY2K8PaLyyq8V Oe91U338ZS4yoIRuAYLnmCgL7GOXWUWGzjAzFw1B8enuWfdUs5RRHoaBHLMVsGRHy6Hj xtTVjBXiVa8nxc10GWZNLI1OWEPGC19Wf9EvkWMNoo9LFoxAxhiEePSjnfC6KsJbsOGs TD5g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q3Ok5PCN; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w13-20020ac857cd000000b00425dd10da3fsi3200271qta.25.2023.12.13.08.48.42 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 08:48:42 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q3Ok5PCN; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 385443861820 for <ouuuleilei@gmail.com>; Wed, 13 Dec 2023 16:48:31 +0000 (GMT) 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 0413D3857001 for <gcc-patches@gcc.gnu.org>; Wed, 13 Dec 2023 16:47:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0413D3857001 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0413D3857001 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702486087; cv=none; b=A5joBkJpWx5edDbXZYbxoTAq8vQsoyqh5jOkyDDQ94pOc6+eEDtBd5g4Bq9yEiozelr2npuPciyy+QOUrIjwiheD6otEhnTm7OnupCvFhN1cSPuDA3lQiP4CHw80ipKPYTrQcMGX/vVp/PAO0qsZQKhJKgnyuye7gAAx9dxTqao= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702486087; c=relaxed/simple; bh=BKDayOjoRw97aeVTsrixomJU1K7QtGmubltXiCN5IG8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Y6bC1a0qFo2pHhF/6v4jVV6gca3gSF+dLkCb66iwrpMN30617jDHd5gkzTOYNWQO/ixrZyOs4fTcFvzxO+o0aVMTUc2YmKMDJFQEI4J7nyEPSwomghXFQDgMewIsgUJoU6YxTSI/ZGCnwk0xdEocyVvAxm4x/NXw/Fb4+H8hor4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702486076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uOsEPe1ZWRgKAULfx7WismIE7BcIIpo1SkPFjoXy9rc=; b=Q3Ok5PCNuNELwGAp6BkmdwpaKlwbOJeuh4tjhbnug1ijJ00EpVsMX2Vhz2vmiyqSptH3gG HKvyWVsjomzL+KD60W6BSVoyjcFFPoQd1mgWECooCp+FRw7A0B6MMbTqyD2FkXJstKRWO+ 3N/QE0eMHhRzpoFh0RU+9byl+Ro+FtM= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-316-a76eH9O6MCyj1V2Xt6zBrQ-1; Wed, 13 Dec 2023 11:47:46 -0500 X-MC-Unique: a76eH9O6MCyj1V2Xt6zBrQ-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-77f96e14ee2so86184185a.1 for <gcc-patches@gcc.gnu.org>; Wed, 13 Dec 2023 08:47:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702486065; x=1703090865; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uOsEPe1ZWRgKAULfx7WismIE7BcIIpo1SkPFjoXy9rc=; b=QQkPexd8doEcZ4XpJgKLWUzXtUG1c27DhxNZConmcaSTKzquBEZFh363DoVMYqdx/H rtSYi4FtjMbzBpNVAOeskr6b5+AHKVmRN9+32qk+ukQwLwP8x31HUjyFardf/TNe4eLy Ga8NNmVDDHQauDz0DiMc11MWKfSav0OOOLbdjeuXwf7ljJ+4KuJG/DYPnU1L9654AvHA z7wliNvQ0fLA0/BTbnHV554SlorBj/9uVZPhSiEMpL9rzSDdFGyffh4TT2ISdij1NtDH EZ+cWYi4agVUbtbaF+lfQkAc4GKne3GeUT1pzclQAJ3PQ656Uj501/0NDa2f0wpf0po+ 0+Ew== X-Gm-Message-State: AOJu0YynMkhVnux7+aPcsHs01ExfBWw5xjI0Ggz7vMaSwN1JbFtz0E7X 76XYnoBbFqU/3mkBdNA0/XHOTngP6JDBQjJWIycRA6UnQDSVsSDeey7KNMzdeYeuKhp9pC66lCM gKBSy7BifpxSgYVzP1wxT/I+DYe9jfJxhaKF33jc4+EowJy10Ioenq49LsybBELZNYoLLKvXg9g == X-Received: by 2002:a05:620a:5603:b0:77f:272f:1e5a with SMTP id vu3-20020a05620a560300b0077f272f1e5amr9317050qkn.60.1702486065416; Wed, 13 Dec 2023 08:47:45 -0800 (PST) X-Received: by 2002:a05:620a:5603:b0:77f:272f:1e5a with SMTP id vu3-20020a05620a560300b0077f272f1e5amr9317042qkn.60.1702486065048; Wed, 13 Dec 2023 08:47:45 -0800 (PST) Received: from jason.com (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id j25-20020a05620a0a5900b0077f37896f24sm4613249qka.97.2023.12.13.08.47.44 for <gcc-patches@gcc.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 08:47:44 -0800 (PST) From: Jason Merrill <jason@redhat.com> To: gcc-patches@gcc.gnu.org Subject: [pushed 3/4] c++: fix in-charge parm in constexpr Date: Wed, 13 Dec 2023 11:47:39 -0500 Message-Id: <20231213164740.1591535-3-jason@redhat.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20231213164740.1591535-1-jason@redhat.com> References: <a24c149c-cf86-4ded-ad7a-7a8b585f6b2b@redhat.com> <20231213164740.1591535-1-jason@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.5 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_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785186088354086662 X-GMAIL-MSGID: 1785186088354086662 |
Series |
[pushed,1/4] c++: copy location to AGGR_INIT_EXPR
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jason Merrill
Dec. 13, 2023, 4:47 p.m. UTC
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- I was puzzled by the proposed patch for PR71093 specifically ignoring the in-charge parameter; the problem turned out to be that when cxx_eval_call_expression jumps from the clone to the cloned function, it assumes that the latter has the same parameters, and so the in-charge parm doesn't get an argument. Since a class with vbases can't have constexpr 'tors there isn't actually a need for an in-charge parameter in a destructor, but we used to use it for deleting destructors and never removed it. I have a patch to do that for GCC 15, but for now let's work around it. gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_call_expression): Handle missing in-charge argument. --- gcc/cp/constexpr.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc index 4cf9dd71b05..9d9e96c2afd 100644 --- a/gcc/cp/constexpr.cc +++ b/gcc/cp/constexpr.cc @@ -3169,6 +3169,19 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t, ctx->global->put_value (remapped, arg); remapped = DECL_CHAIN (remapped); } + for (; remapped; remapped = TREE_CHAIN (remapped)) + if (DECL_NAME (remapped) == in_charge_identifier) + { + /* FIXME destructors unnecessarily have in-charge parameters + even in classes without vbases, map it to 0 for now. */ + gcc_assert (!CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fun))); + ctx->global->put_value (remapped, integer_zero_node); + } + else + { + gcc_assert (seen_error ()); + *non_constant_p = true; + } /* Add the RESULT_DECL to the values map, too. */ gcc_assert (!DECL_BY_REFERENCE (res)); ctx->global->put_value (res, NULL_TREE);