<div class="gmail_quote">On Mon, Oct 10, 2011 at 23:40, 章磊 <span dir="ltr"><<a href="mailto:ioripolo@gmail.com">ioripolo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi clang,<br>
<br>
After read some code relevant to DeclarationName, i have a little<br>
problem about it.<br>
<br>
For some C++ destructor(compile generated?), the base class (have some<br>
virtual member) destructor and the derived class destructor have the<br>
same DeclarationName.<br>
<br>
Examples:<br>
<br>
class base {<br>
<br>
  virtual void foo() const {}<br>
<br>
};<br>
<br>
<br>
<br>
class child: public base {<br>
<br>
  void foo() {}<br>
<br>
};<br>
<br>
if i use LookupPtr to find declarations in the base class with the<br>
derived class destructor's DeclarationName, i will get the base class<br>
destructor. Is this expected? If so,  what does this for?<br></blockquote><div><br>That doesn't sound quite right, but in any case, you shouldn't be using name lookup to find a destructor. Use Sema::LookupDestructor instead.<br>

<br>Sean<br></div></div>