[C++ Patch] Fix a start_decl location

Jason Merrill jason@redhat.com
Tue Jan 8 02:37:00 GMT 2019


On 1/6/19 4:47 AM, Paolo Carlini wrote:
> Hi,
> 
> this was supposed to be very straightforward but required a little more. 
> A first draft of the patch exploited DECL_SOURCE_LOCATION but that 
> failed when I tested the case of a function already defined in class: at 
> that point the location of the decl is that of the in class definition 
> itself not that of the wrong redeclaration. Thus the use of 
> declarator->id_loc. Tested x86_64-linux.
> 
> A final note, about a detail already noticed many other times: the 
> location we store in such cases is that of K not that of f, and that 
> seems suboptimal to me: in principle we should point to f and possibly 
> have the wavy queue of the caret going back to K, at least that's what 
> clang does... no idea id David has this kind of tweak in his todo list.

David has done various work with handling of qualified-id locations, so 
I imagine he'll be interested in this issue.

The patch is OK.

Jason



More information about the Gcc-patches mailing list