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: PATCH to avoid incorrect uses of build


Jason Merrill wrote:
While playing around with another patch, I noticed that we were calling
build() for a number of non-expressions.  This is wrong.

I tried requiring that the code be for an expression, but ran into some
issues.

One, PLACEHOLDER_EXPR doesn't have an expression tree code class.
It probably should.

Two, the C++ frontend uses build (ERROR_MARK, type) in cp_fname_init.  This
is horrible, but I haven't gotten around to fixing it yet.  Nathan, what is
the point of doing that rather than just leaving DECL_INITIAL null?
I think it must be something about it being an initializer for a constant.
Without the init, something else complains. We should be able to be cleaner
by making a better 'magic' initializer with some kind of dependent value.

PR12566 is so I don't forget

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



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