Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!bloom-beacon!apple!gem.mps.ohio-state.edu!wuarchive!cs.utexas.edu!mailrus!cornell!deb
From: deb@svax.cs.cornell.edu (David Baraff)
Newsgroups: comp.lang.c++
Subject: Does C++ 2.0 Emit Following C Construct?
Keywords: address of lvalue
Message-ID: <32793@cornell.UUCP>
Date: 3 Oct 89 15:42:17 GMT
Sender: nobody@cornell.UUCP
Reply-To: deb@cs.cornell.edu (David Baraff)
Distribution: comp
Organization: Cornell Univ. CS Dept, Ithaca NY
Lines: 22

C++ 1.2 emits the following peice of C code often: it is annoying
because some C compilers (i.e. mine, HP-UX 800) don't handle it.

The construct is

	&(f())

where f() returns (usually) a structure. The C compiler says

	error: Address operator requires an lvalue.

Now, I don't want to start a debate over whether or not this is legal
C -- the question is, does C++ 2.0 emit this sort of C code, and if
so, is there a way to stop it? I notice in the 2.0 release notes
the variable "FDOTRIGHT"; but this doesn't look like it would
help (although the HP-UX C compiler DOES allow the f().x expression).

Any C++ 2.0 authors out there who can answer this one?

	Thanks,
		David Baraff
		deb@cs.cornell.edu