public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/7181: foo<n>::bar = foo<n-1>::bar + foo<n-2>::bar evaluates to zero at compile time Date: Tue, 02 Jul 2002 13:16:00 -0000 [thread overview] Message-ID: <20020702201614.29494.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/7181; it has been noted by GNATS. From: Mark Mitchell <mark@codesourcery.com> To: Nathan Sidwell <nathan@codesourcery.com>, "mmitchel@gcc.gnu.org" <mmitchel@gcc.gnu.org>, "dobrynin@bigfoot.com" <dobrynin@bigfoot.com>, "gcc-bugs@gcc.gnu.org" <gcc-bugs@gcc.gnu.org>, "gcc-prs@gcc.gnu.org" <gcc-prs@gcc.gnu.org>, "nobody@gcc.gnu.org" <nobody@gcc.gnu.org>, "gcc-gnats@gcc.gnu.org" <gcc-gnats@gcc.gnu.org> Cc: Subject: Re: c++/7181: foo<n>::bar = foo<n-1>::bar + foo<n-2>::bar evaluates to zero at compile time Date: Tue, 02 Jul 2002 13:08:21 -0700 --On Tuesday, July 02, 2002 08:42:23 PM +0100 Nathan Sidwell <nathan@codesourcery.com> wrote: > mmitchel@gcc.gnu.org wrote: >> >> Synopsis: foo<n>::bar = foo<n-1>::bar + foo<n-2>::bar evaluates to zero >> at compile time >> >> State-Changed-From-To: analyzed->closed >> State-Changed-By: mmitchel >> State-Changed-When: Tue Jul 2 11:31:51 2002 >> State-Changed-Why: >> This code does not have well-defined behavior. > How have you come to this conclusion? The last sentance of > [14.7.1]/1 indicates that we must instantiate the definition of > Foo<N>::value. I see nothing in [3.6.2] or [3.8] which disallows it. > > Or are you saying this is a case of [14.7.3]/7?\ The standard doesn't specifies that the point of instantiation for the various static data members is "the same". It doesn't say which one gets instantiated first. Nor, according to John, does it say which one gets initialized first. So, I think the standard says "all those things get instantiated and initialized in some order" -- but not which order, similar to the example in 3.6.2. These are dynamic initializations; the initializers are not constant expressions. -- Mark Mitchell mark@codesourcery.com CodeSourcery, LLC http://www.codesourcery.com
next reply other threads:[~2002-07-02 20:16 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-07-02 13:16 Mark Mitchell [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-07-02 14:26 Paolo Carlini 2002-07-02 13:56 Nickolai Dobrynin 2002-07-02 13:46 Paolo Carlini 2002-07-02 13:36 Mark Mitchell 2002-07-02 13:36 Paolo Carlini 2002-07-02 12:56 Nathan Sidwell 2002-07-02 11:31 mmitchel 2002-07-01 15:06 Paolo Carlini 2002-07-01 14:56 Nathan Sidwell 2002-07-01 14:20 paolo
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=20020702201614.29494.qmail@sources.redhat.com \ --to=mark@codesourcery.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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: linkBe 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).