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 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


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