On Fri, Jan 30, 2015 at 10:19:26AM +0100, Dodji Seketeli wrote: > [This is a P1 regression for gcc 5] > libcpp/ChangeLog: > > * internal.h (cpp_reader::top_most_macro_node): New data member. > * macro.c (enter_macro_context): Pass the location of the end of > the top-most invocation of the function-like macro, or the > location of the expansion point of the top-most object-like macro. > (cpp_get_token_1): Store the top-most macro node in the new > pfile->top_most_macro_node data member.
The thing that worries me a little bit on the patch is that the new field is never cleared, only overwritten next time we attempt to expand a function-like? toplevel macro. So outside of that it can be stale, point to a dead memory. But if it is guaranteed it won't be accessed in that case, perhaps that is safe. Jakub