<div dir="ltr">Clang has both sugared and concrete types.  By default, getting the type of some AST node will give you information about the type as written.  In this case, two different nested name specifiers were used, so there are two different types.<div>
<br></div><div>If you want to compare types for equivalence, use the canonical types, or simply use ASTContext::hasSameType(QualType, QualType).</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 1, 2014 at 11:02 AM, Daniel Dilts <span dir="ltr"><<a href="mailto:diltsman@gmail.com" target="_blank">diltsman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>In the code below I would expect the CXXRecordDecls for BaseClass1 to have the same Type as both base class specifiers.</div>
<div><br></div><div>When I use getTypeForDecl() on the CXXRecordDecls I get the same Type*.  When I use getType().getTypePtr() on the two CXXBaseSpecifiers I get different a Type* for each one, neither of which is the same as the CXXRecordDecl's Type*.</div>

<div><br></div><div>Namespace N {</div><div>  class BaseClass1;</div><div>}</div><div>class N::BaseClass1 {</div><div>};</div><div>class DerivedClass1 : public N::BaseClass1 {</div><div>};</div><div>class DerivedClass2 : public ::N::BaseClass1 {</div>

<div>};</div><div><br></div><div>This seems to indicate to me that the declared/defined class is of a different type from the base specifiers, and the base specifiers differ in type from each other.</div><div><br></div><div>

What am I doing wrong with this?  I really just want to see if the CXXBaseSpecifier matches the CXXRecordDecl.</div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>