<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 11, 2013, at 10:21 PM, Douglas Gregor <<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div><br class="Apple-interchange-newline">On Apr 9, 2013, at 2:10 PM, jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 9, 2013, at 1:47 PM, Douglas Gregor <<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>> wrote:</div><div><br></div>When we lookup the property in class’s protocol list, we hit forward declarations in the list. It is better to fix the list in one place rather than everywhere we need to look into</div><div>the list. Does this cause a problem for modules? If so, I can move this to where property is looked up. But I think this is a better fix.</div></div></blockquote><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I guess we've discussed this before. In general, I'd rather the AST reflect what was parsed, such that the result in the protocol list is precisely the declaration we saw. However, the Objective-C parts of Sema haven't been made robust against getting forward declarations, so just putting in the definition is livable until we find a better general solution.</div></blockquote><div><br></div>Correct,  For Objective-C, we have not been following this closely. Following is the similar case for forward classes.</div><div>(note in the ast-dump that Sub's ’Super’ is the class definition and not the forward class).</div><div><br></div><div><div>@interface Super @end</div><div><br></div><div>@class Super;</div><div><br></div><div>@interface Sub : Super</div><div>@end</div><div>/**</div><div>|-ObjCInterfaceDecl 0x7fd630827a80 <c.m:1:1, col:19> Super</div><div>|-ObjCInterfaceDecl 0x7fd630827b80 prev 0x7fd630827a80 <line:3:1, col:8> Super</div><div>`-ObjCInterfaceDecl 0x7fd630858610 <line:5:1, line:6:2> Sub</div><div>  |-super ObjCInterface 0x7fd630827a80 'Super'</div><div>*/</div><div><br></div><div>I also see  the same thing in c++ (unless ast-dump is going to class definition which I did not check).  </div><div>Note that base class ’S’  for ’T’ has the source location for ’S’’s class definition  <col:1, col:8>.</div><div><br></div><div><div>struct S {};</div><div>struct S;</div><div>struct T : S {};</div><div><br></div><div>/**</div><div>|-CXXRecordDecl 0x7ff1b1829880 <s.cpp:1:1, col:11> struct S</div><div>| `-CXXRecordDecl 0x7ff1b1829990 <col:1, col:8> struct S</div><div>|-CXXRecordDecl 0x7ff1b1829a20 prev 0x7ff1b1829880 <line:2:1, col:8> struct S</div><div>`-CXXRecordDecl 0x7ff1b1829ab0 <line:3:1, col:15> struct T</div><div>  |-public 'struct S'</div><div>  `-CXXRecordDecl 0x7ff1b1860610 <col:1, col:8> struct T</div><div>*/</div><div><br></div><div>- Fariborz</div><div><br></div></div><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>- Doug</div></blockquote></div><br></body></html>