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: [C++ Patch/RFC] PR 54194


Hi again,

On 10/08/2012 11:44 PM, Jason Merrill wrote:
On 10/08/2012 05:31 PM, Paolo Carlini wrote:
So, there is a serious difficulty, I'm afraid: for the example at issue,
EXPR_LOCATION (arg_left) is 0 not any meaningful value. And of course
EXPR_LOC_OR_HERE would not be better in this case, would give
input_location. So, what do you think? Shall we just go with the loc for
now, or you think there is something relatively safe we can try?
Looks like we still need to SET_EXPR_LOCATION in cp_build_binary_op. It would also be good to have a macro/function like EXPR_LOC_OR_HERE that lets you provide the location to use if the expression doesn't have one.
Thus I'm finishing testing the below (C++ is Ok)

It works pretty well, IMHO: for actual expressions we can have the column number of the operand (which is now fixed up in cp_parser_binary_expression), otherwise, for eg constants, we fall back to the column number of the operator. As a bonus, in templates like Wparentheses-26.C we even get the line number right.

Thanks!
Paolo.

////////////////////////////

Attachment: CL_54194
Description: Text document

Attachment: patch_54194
Description: Text document


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