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: Jason Merrill <jason at redhat dot com>
- Cc: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>, Nathan Sidwell <nathan at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 Aug 2002 10:57:27 -0700
- Subject: Re: Ping: PATCH to generate error for address of cast
On Tuesday, August 20, 2002, at 10:44 AM, Jason Merrill wrote:
Matt, I think this bug is in lvalue_p, and should be fixed there.
Also,
there is already special handling for NOP_EXPR a few lines before,
though
it seems redundant.
The tests are OK, except that tests for extensions go in g++.dg/ext,
and
the positive test needs -fpermissive.
OK, I'll change the tests as suggested.
In principle I agree with you about lvalue_p. In practice there's
an annoying technical issue: we can't just change lvalue_p
unconditionally, because places that use this extension need the
old behavior. We also can't change lvalue_p's interface,
because lvalue_p is declared in tree.h, i.e. it's common to all
front ends. We want to make a C++-only change.
My proposed solution: add new functions, non_cast_lvalue_p and
non_cast_lvalue_or_else, in the C++ front end only. Annoying and
none too pretty, but I don't see a better alternative.
And I agree with you about a pedwarn for use of this extension.
I'm not going to deal with that just yet, though.
--Matt