<div dir="ltr"><div>Looks like MemberExpr carries that information around with it; you can access it via `MemberExpr::hasQualifier` and `MemberExpr::getQualifier`. :)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 13, 2016 at 4:59 AM, Andre Vehreschild via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Verdana;font-size:12.0px"><div>Hi all,</div>

<div> </div>

<div>suppose I have these classes:</div>

<div> </div>

<div>
<div>
<div>#include <iostream><br>
struct A {<br>
virtual void method1() {<br>
  std::cout << "A::method1()\n";<br>
}<br>
};<br>
struct B: A {<br>
void method1() {<br>
  std::cout << "B::method1()\n";<br>
}<br>
};<br>
int main() {<br>
  A* o = new B();<br>
  o->method1();       // <-<br>
  o->A::method1();  // <- Look identical in AST dump.<br>
  return 0;<br>
}</div>
</div>
</div>

<div>In the AST-dump this is printed as (fragment):</div>

<div>
<div>    |-CXXMemberCallExpr 0x80560210 <line:14:3, col:14> 'void'<br>
    | `-MemberExpr 0x805601ec <col:3, col:6> '<bound member function type>' ->method1 0x8055e8b0<br>
    |   `-ImplicitCastExpr 0x805601e0 <col:3> 'struct A *' <LValueToRValue><br>
    |     `-DeclRefExpr 0x805601c8 <col:3> 'struct A *' lvalue Var 0x8055fc28 'o' 'struct A *'<br>
    |-CXXMemberCallExpr 0x805602a0 <line:15:3, col:17> 'void'<br>
    | `-MemberExpr 0x8056026c <col:3, col:9> '<bound member function type>' ->method1 0x8055e8b0<br>
    |   `-ImplicitCastExpr 0x80560258 <col:3> 'struct A *' <LValueToRValue><br>
    |     `-DeclRefExpr 0x8056022c <col:3> 'struct A *' lvalue Var 0x8055fc28 'o' 'struct A *'</div>

<div> </div>

<div>to me both look the same, but clang is able to distinguish them when building the executable. Can you explain how this</div>

<div>is done, or where I have to look to get a clue?</div>

<div> </div>

<div>Your help is very much appreciated.</div>

<div> </div>

<div>Regards,</div>

<div>   Andre</div>

<div> </div>
</div></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>