Message ID | 20230427014542.539011-1-jason@redhat.com |
---|---|
State | Repeat Merge |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp611731vqo; Wed, 26 Apr 2023 18:46:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+EwmEF8fKPPfwCL9edcknTcDGoYXkGnV9zbxXtRNYeN8Ej/NmUelJkce7VpCmVaZJRpZf X-Received: by 2002:a05:6402:749:b0:509:ef47:760 with SMTP id p9-20020a056402074900b00509ef470760mr198199edy.29.1682559998704; Wed, 26 Apr 2023 18:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682559998; cv=none; d=google.com; s=arc-20160816; b=J7XsJIx72E+euOaG3tS0KQ0gmFeDstnmtk6rqAUSRP/VBaqa3tL7+wXORT8K0romR7 7COXQxxWX8mt0QPg2w2arjkBE/nCwi5GHR1YoIfB2pcKO9maaoyIyeGcFiKxnIGbUZ7d rJQm3dvMIdWXLFRObOtZocjIquVSrShNIUHW0VEprLdEywQ2u8nSmDAbP7I59rFuZtM+ Lyjg9b1qFycx/RDuWxPPZKe6wBaGjhtW/rSbDmDy6UlimzxU+6gLNnABJCkvFFbcBp1e 7eQ5J7q+ognc7Nqp26+btp68kUFmWVeLhcdn2yKRDcKcIPWboCA8M6nNCbNCiegZNQfM aPkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=S2D6B4JLdH/xp9PxxZDf52bn+l0uZXa6Lev5fq+LaBE=; b=PtcRRq+jrMDhmUcR3hsQcmO9Y+zFt2HOLZ6cJOp+8IS7p4VGDs1CDBZhB3UszIt4aA 2KbZkChW23erfSZsRcvYp7Om6L+z5H7ABbEv7gZgqueVtxXTmyDsYD5zHEhUiJV8OOmG HLq3yV590Spb5x21OEDXdcpfCkIjBRCJvcEemuwEJU3CHnh4KHll3WmMR9pH39GWZY4M kjXcGWqjS15nhncn73DiS4RCKnwwPPS4+TgAzvF4N05W9WqoGlXnZyFsPEv7meOTLQUi w5XzM8f6FCXr/bR8oC6S5e9hpM8OZRMJEZ//48Ul/pNoXqFqcNxftFIolj/U4bpi2Zg0 3lPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZyEOUUrp; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id by25-20020a0564021b1900b00509e707a2dfsi5804398edb.7.2023.04.26.18.46.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 18:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZyEOUUrp; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 86E94385783F for <ouuuleilei@gmail.com>; Thu, 27 Apr 2023 01:46:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86E94385783F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682559993; bh=S2D6B4JLdH/xp9PxxZDf52bn+l0uZXa6Lev5fq+LaBE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZyEOUUrpxIwOuAXBXNy+yMegK0xVNr8U/zyW45TRrVCTr+V3J4wxtmDHt9BdRlSLy zWP89438rrQ4/SYfusjgGOxuwb8SAte7EVO2yfm81U2TacQdHEzq1eMCLpuxmC/WP+ U0PQweWkQFIJGM9+TUEzW8tLXHw8+bcrEgPZbyhY= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id 7B7463858D3C for <gcc-patches@gcc.gnu.org>; Thu, 27 Apr 2023 01:45:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7B7463858D3C Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-573-NdQ2EdrwPXakhfFWRUMhuA-1; Wed, 26 Apr 2023 21:45:46 -0400 X-MC-Unique: NdQ2EdrwPXakhfFWRUMhuA-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-3ef67ad5ffaso74293921cf.2 for <gcc-patches@gcc.gnu.org>; Wed, 26 Apr 2023 18:45:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682559945; x=1685151945; 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=S2D6B4JLdH/xp9PxxZDf52bn+l0uZXa6Lev5fq+LaBE=; b=AZpqNiNqKkpISfaras9NgsPmRjVl7Cp526l5y8wJuQ4DdrpApUUa6X/6R9JdZvLXkv SRyVBlaUZt6No+WXGMb1r0Okq/s1W+kBoZxIfIW/Zg7Bp0Mzjuizgs3nCvXQ2pOL2fDC /qEoN3Ppc48p8Oh+DWOmoFQe3hCHlmysU3qDA6xt0JtX/B1JM0QPpeiVMxmoY+F6AZF9 LUnicPIvCe6onvAMZQGrP3BdKOOBZ34iCzUBISMBq7ZDpgVg8lGHgcxjCwc9dWIXw3A7 3YC1aVIAmGW+JpHqgCvCG/pWsqENB7dL1W2K1sEZzCEcxu8rSK6eUYXvscwCD5mttsyy Ny+g== X-Gm-Message-State: AAQBX9cf/fqzqAjt7HOWXEjd8jiCgpVKKkOndO4mUUcFfy/c7vdSq/No 9B0mXz2x2zPdEkLoOVZSKItBNe64OS8mUxH2sf3y0vxsGSxeRDfRmm5YeylnxQlIN1CajYrTdzO oKhXxJ1f/HVVa5E3Le0+TUED5m3XCRT9IkI+LJedB4M9tpOU8gO35DoXYZwdCOrPxDpU/Dxmv7g == X-Received: by 2002:ac8:5bd5:0:b0:3ed:164c:684a with SMTP id b21-20020ac85bd5000000b003ed164c684amr41809512qtb.40.1682559945648; Wed, 26 Apr 2023 18:45:45 -0700 (PDT) X-Received: by 2002:ac8:5bd5:0:b0:3ed:164c:684a with SMTP id b21-20020ac85bd5000000b003ed164c684amr41809496qtb.40.1682559945282; Wed, 26 Apr 2023 18:45:45 -0700 (PDT) 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 f1-20020ac80681000000b003ef3eae106csm5716144qth.60.2023.04.26.18.45.44 for <gcc-patches@gcc.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 18:45:44 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [pushed] c++: restore instantiate_decl assert Date: Wed, 26 Apr 2023 21:45:42 -0400 Message-Id: <20230427014542.539011-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.9 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, 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.29 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> From: Jason Merrill via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jason Merrill <jason@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764292032953259389?= X-GMAIL-MSGID: =?utf-8?q?1764292032953259389?= |
Series |
[pushed] c++: restore instantiate_decl assert
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Jason Merrill
April 27, 2023, 1:45 a.m. UTC
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- For PR61445 I removed this assert, but PR108242 demonstrated why it's still useful; to avoid regressing the former testcase I check pattern_defined in the assert. This reverts r212524. PR c++/61445 gcc/cp/ChangeLog: * pt.cc (instantiate_decl): Assert !defer_ok for local class members. --- gcc/cp/pt.cc | 6 ++++++ 1 file changed, 6 insertions(+) base-commit: 9b40ca2569d71e54d7dbbdbfd00d733770576f6f
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 93a055c66a1..6df16fef0dd 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -27090,6 +27090,12 @@ instantiate_decl (tree d, bool defer_ok, bool expl_inst_class_mem_p) pattern_defined = ! DECL_EXTERNAL (code_pattern); } + /* Any local class members should be instantiated from the TAG_DEFN + with defer_ok == 0. */ + gcc_checking_assert (!defer_ok || !pattern_defined + || !decl_function_context (d) + || LAMBDA_TYPE_P (DECL_CONTEXT (d))); + /* We may be in the middle of deferred access check. Disable it now. */ push_deferring_access_checks (dk_no_deferred);