<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I have the following file:<div><br><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span style="color: #d200a9">@protocol</span> MyProtocol</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">- (<span style="color: #d200a9">void</span>)someProtocolMethod;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(210, 0, 169); ">@end</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span style="color: #d200a9">@interface</span> MyBaseClass <MyProtocol> {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> <span style="color: #d200a9">id</span> myIvar;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">}</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(210, 0, 169); ">@end</div></div><div><div><br></div><div>When printing out the AST node for the @protocol declaration, I get:</div><div><div>$4 = {</div><div> DeclKind = clang::Decl::ObjCProtocol, </div><div> ExternalLexicalStorage = false, </div><div> ExternalVisibleStorage = false, </div><div> LookupPtr = 0x0, </div><div> FirstDecl = 0x1033160c0, </div><div> LastDecl = 0x1033160c0</div><div>}</div></div><div><br class="webkit-block-placeholder"></div><div>However, when I print out the AST node for <MyProtocol>, I get a different value:</div><div><div>$5 = {</div><div> <clang::Decl> = {</div><div> _vptr$Decl = 0x1016f80d0, </div><div> NextDeclInContext = 0x103316150, </div><div> DeclCtx = {</div><div> Val = {</div><div> Value = 4348516192</div><div> }</div><div> }, </div><div> Loc = {</div><div> ID = 2</div><div> }, </div><div> DeclKind = clang::Decl::ObjCProtocol, </div><div> InvalidDecl = 0, </div><div> HasAttrs = 0, </div><div> Implicit = false, </div><div> Used = false, </div><div> IdentifierNamespace = 16, </div><div> Access = 0</div><div> }, </div><div> members of clang::NamedDecl: </div><div> Name = {</div><div> Ptr = 4353910984</div><div> }</div><div>}</div><div><br></div><div>I was under the impression that clang would resolve references. So MyProtocol would be the same in both places. If not, how do I resolve these references?</div><div><br></div><div>Thanks.</div><div><br></div><div>Kevin</div><div><br></div></div><div>
<span class="Apple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><font class="Apple-style-span" face="'Myriad Set'">-------------------------------------------------</font></div><div><font class="Apple-style-span" face="MyriadSet-Bold"><b><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">Kevin Cathey</span></font></b></font></div><div><font class="Apple-style-span" face="'Myriad Set'"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">Department of Computer Science - College of Engineering</span></font></font></div><div><font class="Apple-style-span" face="'Myriad Set'"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px; ">University of Illinois Urbana Champaign</span></font></font></div><br class="Apple-interchange-newline"></span></span></div></span></div></span>
</div>
<br></div></div></body></html>