From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id 927893858C83 for ; Mon, 26 Sep 2022 14:08:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 927893858C83 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-x72a.google.com with SMTP id h28so4171081qka.0 for ; Mon, 26 Sep 2022 07:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date; bh=8lvU48AhkdmKUg8gdgqzWk41Zo6DRxHWcNWOIPFxqIg=; b=RpYhRd2vPPC9u5rvAowehhsWVKKa54nBfAmkoq1KsZiSdcIGoS5x9hxpS5IKUhiSyy IqQgO0V0mYCKPkRToZG4ToKHBlQV/jR5JnTbVh+sOpPtN8r5Iz8PiodnA7EMn2ji0Y2Z oRi7fyoEzdIU51t5w/ax9R7CwngdgJmGVzelsn9uu/L61SIcl2Q85JFmyUmA192fOEP5 ugeRzYpT2hUUvGluEKIxY7wJ7tbrAZGZOuHiWCgWTh+XF14VANlzp4pQxRu1zfRvqqR6 vZVSrDngWciKYfU/TXXtJ2OETRY9iHuekvacdzX/cl/Rvm1KgMKpCDNhgVy0cL+Go7oo NLyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date; bh=8lvU48AhkdmKUg8gdgqzWk41Zo6DRxHWcNWOIPFxqIg=; b=bHOOGJL0KB9WaBjqPNziHnxIufRpCzS5pYymNLECoFvAaEDpxLOHTUq8mjxUPZnel8 iIbLOM9UV3F9KYAYa7lpFIVCcWm5MkZVFPQOtk8WdPHoYLx2qyH8OXkL5o+ctbJLDIKS ug7Dr7tYdvHg+O8UyjrdVIkyzO5vFnEbI5iUuxmIprEvY1wvs7KEHDSgmBLEDjKoUKc2 sy7RWZDhP1JxXaYbDgqjoerqxIkYpXSJuLYQlcjGKVDomCdlQ1oTPxVnQcqqHbVaCH2h v4Eh2kbKSSmA1ANsfDRInuWR1R0V/L8HbE+jF+63HZYIWp1CHG43lUmVig6p18XklAJv QUlw== X-Gm-Message-State: ACrzQf3ShfjlvzZPA8YEgQzvu+Re00iXjlg/7OsnGqfg2XXN+uniGfMq If93wdU0+8bwND8ikXlLzRM= X-Google-Smtp-Source: AMsMyM66YIQRr7szLRjoH7dLK8PkOwIFg70afBS/Fiy8T+SCcjoL0hUqgrx3Y5/l6kT7Nhgqj1UUag== X-Received: by 2002:a05:620a:c55:b0:6a7:9e01:95c9 with SMTP id u21-20020a05620a0c5500b006a79e0195c9mr14420493qki.63.1664201296657; Mon, 26 Sep 2022 07:08:16 -0700 (PDT) Received: from ?IPV6:2620:10d:c0a3:1407:bb5b:4f29:715d:d2b6? ([2620:10d:c091:500::6:a953]) by smtp.googlemail.com with ESMTPSA id d7-20020a05620a240700b006cede93c765sm11991626qkn.28.2022.09.26.07.08.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Sep 2022 07:08:15 -0700 (PDT) Sender: Nathan Sidwell Message-ID: Date: Mon, 26 Sep 2022 10:08:14 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH] c++ modules: ICE with class NTTP argument [PR100616] Content-Language: en-US To: Patrick Palka Cc: gcc-patches@gcc.gnu.org, jason@redhat.com References: <20220922182502.3218391-1-ppalka@redhat.com> <91a5a188-c4f2-39ff-fff4-8a667f515a19@acm.org> <0745ddf7-8e48-909b-d8e2-a9a1e4064cef@idea> From: Nathan Sidwell In-Reply-To: <0745ddf7-8e48-909b-d8e2-a9a1e4064cef@idea> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3032.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On 9/23/22 09:32, Patrick Palka wrote: > Judging by the two commits that introduced/modified this part of > maybe_register_incomplete_var, r196852 and r214333, ISTM the code > is really only concerned with constexpr static data members (whose > initializer may contain a pointer-to-member for a currently open class). > So maybe we ought to restrict the branch like so, which effectively > disables this part of maybe_register_incomplete_var during stream-in, and > guarantees that outermost_open_class doesn't return NULL if the branch is > taken? I think the problem is that we're streaming these VAR_DECLs as regular VAR_DECLS, when we should be handling them as a new kind of object fished out from the template they're instantiating. (I'm guessing that'll just be a new tag, a type and an initializer?) Then on stream-in we can handle them in the same way as a non-modules compilation handles such redeclarations. I.e. how does: template struct C { }; struct A { }; C c1; // #1 C c2; // #2 work. Presumably at some point #2's A{} gets unified such that we find the instantation that occurred at #1? I notice the template arg for C is a var decl mangled as _ZTAXtl1AEE, which is a 'template paramete object for A{}'. I see that's a special mangler 'mangle_template_parm_object', called from get_template_parm_object. Perhaps these VAR_DECLs need an additional in-tree flag that the streamer can check for? nathan -- Nathan Sidwell