This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Set expr loc safely (PR c++/58516)
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, jason at gcc dot gnu dot org
- Date: Tue, 24 Sep 2013 12:00:41 -0500
- Subject: Re: [PATCH] Set expr loc safely (PR c++/58516)
- Authentication-results: sourceware.org; auth=none
- References: <20130924163558 dot GE12296 at redhat dot com>
On 9/24/13 11:35 AM, Marek Polacek wrote:
I admit I haven't spent much time on this, but it seems we should just
check whether we can set the expr location before actually setting it...
Regtested/bootstrapped on x86_64-linux, ok for trunk?
Two minor nits (assuming the general idea makes sense, first blush it does).
First, solicited by the ChangeLog entry too and given that non-null
expression trees can always have locations, I wonder if we shouldn't
check EXPR_P instead, it seems more direct, unless we really fear that
body could be NULL_TREE. I would also phrase in a negative form the
comment before the check, like "This may not be true when..."
Second, I'm pretty sure about this one, I think we are standardizing on
c++11 for testcases, by now c++0x is essentially legacy.