Path: utzoo!utgpu!watserv1!watmath!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: subtle inlining/sequence points bug in CFront 2.0 Keywords: inline, CFront, bug Message-ID: <10787@alice.UUCP> Date: 4 May 90 22:52:51 GMT References: <8066@goofy.Apple.COM> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 20 In article <8066@goofy.Apple.COM>, scott@goofy.apple.com (scott douglass) writes: > void g(A* a) > { > int b = ( a->get_next()->i == a->f() ); > } > Assume that A::f() may change A::next which CFront must since A::f() > if not a const member. Since order of evaluation is not defined for > expressions either a->get_next() or a->f() will happen first, but > the "->i" will definetly refer to one of two possible As. My personal inclination is to treat any expression in which one part changes something that another part fetches as an error. Ultimately, though, this is the kind of thing that is going to be decided by the ANSI C++ committee. -- --Andrew Koenig ark@europa.att.com