On Wed, 2017-10-11 at 15:51 -0400, Jason Merrill wrote: > On Tue, Sep 26, 2017 at 3:27 PM, David Malcolm <dmalc...@redhat.com> > wrote: > > * cp-tree.h (struct saved_scope): Add "location" field. > > saved_scope seems like the wrong place for this; it's only > interesting > at parse time, so having it saved during template instantiation > doesn't seem useful. I'd prefer to put it in cp_parser and have > maybe_show_extern_c_location look in the_parser.
Thanks. I have a new version of the patch *mostly* working that way, but one of the uses of maybe_show_extern_c_location is within decl.c:grokfndecl (when complaining about user-defined literal operators within C linkage), and there doesn't seem to be access to the cp_parser * from there. I could fix this by adding a cp_parser * for this to grokfndecl, which would mean adding it to grokdeclarator, but I get the impression that the code is structured so that the decl-handling isn't meant to know about the parser. Thoughts? Dave