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] More location fixes to grokdeclarator


Hi,

On 28/06/2018 03:22, David Malcolm wrote:
[snip]
If I'm following you right, the idea is that gcc should complain
because two different things in the user's source code contradict
each
other.

In such circumstances, I think we ought to try to print *both*
locations, so that we're showing, rather than just telling.
Or to put in another way, if two things in the user's source contradict
each other, we should show the user both.  The user is going to have to
decide to delete one (or both) of them, and we don't know which one,
but at least by showing both it helps him/her take their next action.
Sure, makes sense. Thus the below uses rich_location the way you explained. I also added 2 specific testcases and extended a bit another one to exercise a bit more min_location..Of course the patch doesn't add max_location anymore, I suspect we are not going to find uses for a max anytime soon, because we really want rich_location with multiple ranges in all those cases...

Thanks!
Paolo.

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


Attachment: patch_locs_10e
Description: Text document


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