[cfe-dev] objc method lookup in super class implementation
Jean-Daniel Dupas
devlists at shadowlab.org
Sun Mar 8 10:22:13 PDT 2009
A second version.
The "Lookup Private Instance Method" code is factored in a Sema method
that is used in default method lookup,
super method lookup and also to find instance method of the root class
in class method lookup.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lookup-private.patch
Type: application/octet-stream
Size: 7448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090308/3ad76fa2/attachment.obj>
-------------- next part --------------
Le 8 mars 09 à 18:03, fjahanian a écrit :
> This patch is good and matches gcc's behavior (Steve's comment
> withstanding).
> But a future strategy would be to do this checking as a final pass
> over all implementations,
> to avoid warning being dependent on order of @implementation
> declarations.
> Compile time would be a concern in that case, but multiple
> implementations in
> one TU is generally not that common.
>
> - Fariborz
>
> On Mar 8, 2009, at 4:09 AM, Jean-Daniel Dupas wrote:
>
>> Hello,
>>
>> When clang lookup a method, it searches in the class implementation
>> if it is in scope, but it does not try to search in super class
>> implementation that may be in the scope too.
>>
>> The result is that it emits "may not responds to selector" warning
>> where it is obvious that the object will, as its superclass
>> implement it.
>>
>> Here is a patch to lookup in superclasses implementations (if in
>> scope), and a test case.
>>
>>
>>
>> <lookup-superimpl.patch>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
More information about the cfe-dev
mailing list