<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Jul 11, 2018 at 6:35 AM Eric Liu <<a href="mailto:ioeric@google.com">ioeric@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><div><div>Example: <br></div><div>```<br class="m_-8381132614660891925inbox-inbox-Apple-interchange-newline">namespace nx {    </div><div>class X {};       </div><div>void ff(X &x) {}  </div><div>}  // namespace nx</div><div>                  </div><div>int main() {      </div><div>  nx::X x;        </div><div>  ff(x);   // ADL</div><div>}                 </div></div><div>```</div></div><div><br></div><div>I am wondering if this is possible given the reference expression and the ASTContext.<br></div></div></blockquote><div><br></div><div>You could redo the unqualified lookup from the context of the call expression, filter out any lookup results that are first declared after the expression, and see if the callee is in the resultant lookup set. Other than that, no, we don't track that information on the AST.</div></div></div>