<div dir="ltr">On Fri, Apr 12, 2013 at 10:26 AM, jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com" target="_blank" class="cremed">fjahanian@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div class="im"><div>On Apr 11, 2013, at 10:21 PM, Douglas Gregor <<a href="mailto:dgregor@apple.com" target="_blank" class="cremed">dgregor@apple.com</a>> wrote:</div>
<br></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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div class="im"><div><br>On Apr 9, 2013, at 2:10 PM, jahanian <<a href="mailto:fjahanian@apple.com" target="_blank" class="cremed">fjahanian@apple.com</a>> wrote:</div><br></div><blockquote type="cite"><div style="word-wrap:break-word">
<br><div><div class="im"><div>On Apr 9, 2013, at 1:47 PM, Douglas Gregor <<a href="mailto:dgregor@apple.com" target="_blank" class="cremed">dgregor@apple.com</a>> wrote:</div><div><br></div></div><div class="im">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><div class="im"><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></div></blockquote><br></div><div class="im">
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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>
</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></div></blockquote><div><br></div><div style>No, the output is a bit confusing and you've misinterpreted it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><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></blockquote><div><br></div><div style>This is T's injected-class-name, not the 'S' base class. The source range here is column 1 to column 8, of the most-recently-mentioned line (line 3).</div>
</div></div></div>