This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ping: PATCH to generate error for address of cast
- From: Matt Austern <austern at apple dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 Aug 2002 11:30:34 -0700
- Subject: 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