From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16462 invoked by alias); 27 Jun 2002 11:14:46 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 16433 invoked by uid 61); 27 Jun 2002 11:14:44 -0000 Date: Thu, 27 Jun 2002 05:00:00 -0000 Message-ID: <20020627111444.16432.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, lindahlb@hotmail.com, nobody@gcc.gnu.org, unifex@yuidesigns.net From: nathan@gcc.gnu.org Reply-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 Subject: Re: c++/7135: Faulty Operator Precedence X-SW-Source: 2002-06/txt/msg00651.txt.bz2 List-Id: Synopsis: Faulty Operator Precedence State-Changed-From-To: open->feedback State-Changed-By: nathan State-Changed-When: Thu Jun 27 04:14:43 2002 State-Changed-Why: I beleive the code is ill-formed. I agree the code is equivalent to operator<<(operator<<(cout, a.set(5).get()), a.set(30).get()); which I'll rewrite as Foo (Baz (cout a.Wibble (5)), a.Wobble (30))) 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 between the a.Wobble (30) call and the a.Wibble (5) call. i.e. in evaluating the argyments to Foo, I could a.Wobble (30) a.Wibble (5) cout call Baz call Foo I cout reorder the a.Wibble and a.Wobble calls. your example had a.Wobble (5).Fetch1 () and a.Wibble (30).Fetch2 (), those fetch calls are similarly unorderd. Provided the appropriate Fetch occurs after the Wibble/Wobble call, C++ semantics are maintained. Let me know if you disagree with my analysis http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7135