r179108 - Objective-C: This patch fixes a none-issuance of warning

Douglas Gregor dgregor at apple.com
Thu Apr 11 22:21:17 PDT 2013


On Apr 9, 2013, at 2:10 PM, jahanian <fjahanian at apple.com> wrote:

> 
> On Apr 9, 2013, at 1:47 PM, Douglas Gregor <dgregor at apple.com> wrote:
> 
>> 
>> On Apr 9, 2013, at 10:52 AM, Fariborz Jahanian <fjahanian at apple.com> wrote:
>> 
>>> Author: fjahanian
>>> Date: Tue Apr  9 12:52:29 2013
>>> New Revision: 179108
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=179108&view=rev
>>> Log:
>>> Objective-C: This patch fixes a none-issuance of warning
>>> when result type of protocol property and getter method
>>> differ by fixing a more serious problem. When a forward
>>> protocol declaration comes between its definition and
>>> its use in class protocol list, the forward protocol
>>> ast was being used in building the protocol list.
>>> // rdar://12522752
>> 
>> Why is this a problem? The protocol list could have a reference to the protocol declaration that was actually visible, and the callers that need definitions should use getDefinition().
> 
> 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
> 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.

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.

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130411/1b3f8c8d/attachment.html>


More information about the cfe-commits mailing list