From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 60CC33858D39 for ; Fri, 2 Dec 2022 09:16:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60CC33858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62a.google.com with SMTP id y17so4116656plp.3 for ; Fri, 02 Dec 2022 01:16:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=PGSI2DVkJZntWOa7OdrPgy10RhGfOFjTzuaRf9yJgIA=; b=diG56tFJ0Oyr/8wLNj+rVoPyfWj0CUawaC1v3/SIDxgSE8Sa7cEW/fKbwZVqbKRoyw So2qbBhLkkHKwChBgdwXPKBpWgQEn5bRrBKefH4FJboMdpQFLgw9Vt4Ey2r7rr0fG22l qzzkP3QRQOcP2manOhU5EtoF6pm3ArqLpBYzoCQsZApZ+tZ2hdhfhpCWEV5Uye1BTBCt edlZrbOktULjzSwPetOm5rre6kNn/IBBGNCgrDiKjJU45yTf/EiwkYeiVZof39kmzP8O QPpJAZ5g+9F6Nw1pYIQE7ceTrOu6ET+xBpW2hnn6Giqd2McjLO76s4OYYMq8IkCv43Zm 5oEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PGSI2DVkJZntWOa7OdrPgy10RhGfOFjTzuaRf9yJgIA=; b=wYKsV1hxHhpGu6tvPIU17sDtOPwKPrZJK+kNLm1DwrNfYacYhCWX8Zw/UIw2K8UZ6D zlUTGSpRTHb+H+3qvfWITjRyaL16ypVZtA6IV5YJwDyA16wPA3e+HKEq0xo/Vn3R2VX0 t2W95/nsjp5kOALzhcUVTjh5NaDPaxMEuXLpa9CALl84C9DoC3bbNTpEcByK1LZUZdgV rWvXSrCZJt1M3d/0bZl2W4PIw0gCP9OrGMVQLZ4uO1mqfi6TpRfAP8scXyGfHW1s2yIM HvZeeklD2lhGkECVtZfzkDTyVSFScOpvsbbaLXmQ5Crd2GdQDJMab9F00VUGEi3eSy+A Cqhw== X-Gm-Message-State: ANoB5pm3M2ZZrrZiT7y644xxTFYdS3CZPp4GZ3jg8kwXQc/COJf8fWCE hmWTAOnJvLQKzRdLwHzb+Kpf1M19LpZ6sSZcHhPT9VcoOtM= X-Google-Smtp-Source: AA0mqf6T3m/cWh81+AaRYcB0qbvMymdnVk9kN6H2mCgB6SVB6hTcM5ZLLSQ9JDu+tM5BcYx+T9w/FRrt5rUe+km3Ig8= X-Received: by 2002:a17:902:900c:b0:189:8d8b:9db7 with SMTP id a12-20020a170902900c00b001898d8b9db7mr23394741plp.150.1669972581334; Fri, 02 Dec 2022 01:16:21 -0800 (PST) MIME-Version: 1.0 References: <81026ee4-8f45-3d45-57ca-a9abed92c722@126.com> <69b994c3-b1e2-6752-4bc0-5d706bfc0da3@126.com> In-Reply-To: From: leon zadorin Date: Fri, 2 Dec 2022 20:16:09 +1100 Message-ID: Subject: Re: which compiler is right (either to compile or to barf)... To: gcc-help Content-Type: multipart/alternative; boundary="0000000000007ec69d05eed4ca04" X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,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: --0000000000007ec69d05eed4ca04 Content-Type: text/plain; charset="UTF-8" Sorry, just one more question :) So if we have static ::std::foo f; and foo indeed considers S to be complete... is it then permitted to reference S's members and call S's member functions (like dtor()) in foo's constructor? I guess a silly consideration would be foo's constructor where it would create a temporary S and destroy it (for no specific reason other than to illustrate a point)... e.g. foo::foo() { S tmp; } now... if S type had a member of vector with incomplete type and standard allows for vector itself to be instantiated but not its members when T is incomplete as per vector.overview] 4) ... then at a time of '~S' (tmp being destructed) would not vector's destructor also be called? ... and at that point in time will it not reference the members of vector? Perhaps I am confusing myself with 'instantiation' of template types vs 'creation' of variables... at a time of 'static ::std::foo f', i.e. the 'f' variable being actually created... the S.v (our vector of incomplete type) would already be instantiated/type-complete (as in: concrete type inferred from template processing)? Sorry for all the naive questions here -- haven't dived into this thinking for a while... getting old :) --0000000000007ec69d05eed4ca04--