public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: "Brian Lindahl" <lindahlb@hotmail.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/7135: Faulty Operator Precedence Date: Thu, 27 Jun 2002 13:16:00 -0000 [thread overview] Message-ID: <20020627185602.20227.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/7135; it has been noted by GNATS. From: "Brian Lindahl" <lindahlb@hotmail.com> To: nathan@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, lindahlb@hotmail.com, nobody@gcc.gnu.org, unifex@yuidesigns.net, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/7135: Faulty Operator Precedence Date: Thu, 27 Jun 2002 11:47:27 -0700 First of all, I disagree with your analysis. One fact alone should contradict the analysis: Inlining the methods changes the compiler output, and thus, the output displayed on the screen. I believe that, according to C++ semantics, inlining a function should not change compiler output. I think the problem in my example was the naive expansion of the code from: cout << a.set(5).get() << a.set(30).get(); To: operator<<(operator<<(cout, a.set(5).get()), a.set(30).get()); In fact, I should have stated that the code should be equivalent to: operator<<( operator<<( cout, A::get( &A::set(5, &a) ) ), A::get( &A::set(30, &a) ) ); (Note the method, set, returns '*this' as a 'const A &') > There are 4 sequence points in that, each between > evaluating the parameters to a call, and the call itself. > These sequence points are partially ordered, but not > completely ordered. In particular there is no ordering As shown above, there are more than 4 sequence points, in evaluating the parameters of the parameters of the call. Furthermore, the existance of parenthesis creates a need, I believe, for complete ordering, not the partial ordering you suggest. > completely ordered. In particular there is no ordering > between the a.Wobble (30) call and the a.Wibble (5) call. Correct, in particular. But because they are contained in different layers of parenthesis, there is a complete ordering in the code. I hope I understood what you meant correctly, -Brian Lindahl _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
next reply other threads:[~2002-06-27 18:56 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-06-27 13:16 Brian Lindahl [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-06-30 2:57 Nathan Sidwell 2002-06-30 2:56 nathan 2002-06-27 5:00 nathan 2002-06-26 17:46 lindahlb
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=20020627185602.20227.qmail@sources.redhat.com \ --to=lindahlb@hotmail.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).