Stricter ObjC warning 'class' may not respond to 'selector'

Hi,
currently clang compiles following code with a warning "'FooClass' may
not respond to 'barMethod'"

//foo.h
#import <Foundation/NSObject.h>
@interface FooClass : NSObject {
}
- (void)fooMethod;
@end

//bar.h
#import <Foundation/NSObject.h>
@interface BarClass : NSObject{
}
- (void)barMethod;
@end

//handleFoo.m
#import "bar.h"
#import "foo.h"

void handleFoo(FooClass *foo) {
  [foo barMethod];
}

But if instead of #import "foo.h" we forward declare FooClass, i.e.
#import "bar.h"
@class FooClass;

void handleFoo(FooClass *foo) {
  [foo barMethod];
}

then there is no warning.

By currently I mean Apple clang version 2.0 (tags/Apple/clang-139)
(based on LLVM 2.9svn) and clang built from r139743.

I think it would be useful to emit warning in case of forward
declaration. What do you think?

Regards,
Volodymyr Sapsai

This is still happening with clang version 3.0 (trunk 139473).

Can you file a bug at http://llvm.org/bugs? (Maybe it's intentional,
but it looks like a bug to me.)

Nico

Have filed a bug http://llvm.org/bugs/show_bug.cgi?id=10956 It might
be not a bug, but at least information that such behavior is
intentional will be available in issue tracker.