[cfe-dev] objc method lookup in super class implementation

fjahanian fjahanian at apple.com
Sun Mar 8 10:03:23 PDT 2009


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