This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ping: PATCH to generate error for address of cast


On Wednesday, August 14, 2002, at 10:54 AM, Nathan Sidwell wrote:

Matt Austern wrote:

(By the way, you might be wondering why I'm doing all this
complicated stuff instead of just fixing lvalue_or_else.  Answer:
I found that changing lvalue_or_else breaks the case-as-lvalue
extension in a couple places.  Having a regression test suite is
What are the semantics for cast-is-lvalue extension? (why is &(t)thing
not allowed, but some other lvalue use is ok?)
I don't know.  In my opinion, the cast-is-lvalue extension is poorly
documented.  But the documentation does clearly say that even
with the extension it's incorrect to take the address of a cast, and
that's how the C front end behaves.  The C++ front end was clearly
trying to do that too; as Gaby noticed, this is obviously a cut-and-
paste error.

I preferred a narrow change, rather than anything involving
lvalue_or_else or lvalue_p, precisely because I didn't understand
the complete specification of the cast-is-lvalue extension.  I wanted
to fix one very clear deviation from the closest thing we've got to a
specification.

I agree that getting rid of underspecified extensions would in
general be A Good Thing.  I'd like to keep that separate, though.

			--Matt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]