From: leon zadorin <leonleon77@gmail.com>
To: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: which compiler is right (either to compile or to barf)...
Date: Fri, 2 Dec 2022 20:16:09 +1100 [thread overview]
Message-ID: <CAPpySAb7v3f=WS=yYMckWv82k8eyzTsex_YWaexAc+q1Hnv0BQ@mail.gmail.com> (raw)
In-Reply-To: <CAPpySAZT2NO0My+YA_+2D0-ZWbHgWjxw+weKiJ6Hg-2_96prEw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
Sorry, just one more question :)
So if we have
static ::std::foo<S> 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<S> 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 :)
next prev parent reply other threads:[~2022-12-02 9:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 4:51 leon zadorin
2022-12-01 9:35 ` LIU Hao
2022-12-01 23:26 ` leon zadorin
2022-12-01 23:54 ` Jonathan Wakely
2022-12-01 23:56 ` Jonathan Wakely
2022-12-02 0:17 ` leon zadorin
2022-12-02 6:37 ` LIU Hao
2022-12-02 7:18 ` leon zadorin
2022-12-02 7:22 ` leon zadorin
2022-12-02 7:45 ` LIU Hao
2022-12-02 8:34 ` leon zadorin
2022-12-02 9:16 ` leon zadorin [this message]
2022-12-02 10:50 ` leon zadorin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPpySAb7v3f=WS=yYMckWv82k8eyzTsex_YWaexAc+q1Hnv0BQ@mail.gmail.com' \
--to=leonleon77@gmail.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).