<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Thu, 15 Nov 2018, 01:56 Shyan Akmal <<a href="mailto:sakmal@g.hmc.edu">sakmal@g.hmc.edu</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for your response. <div><br></div><div>I worded my question very poorly, sorry about that. In 1, I meant to ask <i>how</i> one can find the location of a name being declared (in the file overall - included the expanded headers). This is because plan was to find the declaration location, and then try to use getUnderlyingDecl() at that node to figure out the full nested-name-specifier required for a fully qualified name.</div><div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I'm a bit confused by this - there might not be a fqn ever spelled out. Perhaps if you give an example that would help :)</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>There could definitely be an alternate, better approach that I'm not seeing though. </div><div><br></div><div>Thanks for the suggestion - I'll look into printQualifiedName. </div><div><br></div><div>- Shyan</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018 at 1:00 AM Manuel Klimek <<a href="mailto:klimek@google.com" target="_blank" rel="noreferrer">klimek@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018 at 3:25 AM Shyan Akmal <<a href="mailto:sakmal@g.hmc.edu" target="_blank" rel="noreferrer">sakmal@g.hmc.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I'm working on a check for fully qualifying names in using declarations. </div><div><br></div><div>When creating an alias for an object outside the file, this just involves prepending the global specifier, so that " using foo::f; " becomes " using ::foo::f; ". </div><div><br></div><div>However, this shouldn't work in general for objects declaring in the existing file. </div><div><br></div><div>For example, for code like</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">namespace example { </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">namespace util { </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">namespace internal {  </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">enum Color {Red, Green, Blue}; </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">}  </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">using internal::Color; </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">  </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">} </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">} </blockquote><div><br></div><div>I'd like to replace "internal::Color" with "::example::util::internal::Color" instead of "::internal::Color". </div><div><br></div><div>Given this motivation, I have two questions:</div><div><ol><li>Given a name inside a using declaration, what's the best way to check if that name is declared in the current file?</li></ol></div></div></blockquote><div><br></div><div>Why does that matter? Can't the same happen across files? </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><ol><li>Given an object declaration, what is the recommended way of finding it's full nested-name-specifier? (I think getUnderlyingDecl() probably works here)</li></ol></div></div></blockquote><div>I think printQualifiedName on the namedDecl is your best bet; I don't know how getUnderlyingDecl() would help?</div><div><br></div><div>Cheers,</div><div>/Manuel</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>
</blockquote></div>
</blockquote></div></div></div>