[LLVMbugs] [Bug 10956] New: No warning "'class' may not respond to 'selector'" for forward declared ObjC class

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 18 12:44:22 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10956

           Summary: No warning "'class' may not respond to 'selector'" for
                    forward declared ObjC class
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: vsapsai.llvm.bugs at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=7296)
 --> (http://llvm.org/bugs/attachment.cgi?id=7296)
Files mentioned in steps to reproduce

clang doesn't emit warning "'class' may not respond to 'selector'" for forward
declared ObjC class.

STEPS TO REPRODUCE:
Compile file handleFoo.m, where (corresponding files are attached)

//handleFoo.m
#import "bar.h"
@class FooClass;

void handleFoo(FooClass *foo) {
       [foo 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

ACTUAL RESULTS:
There are no warnings during compilation.

EXPECTED RESULTS:
Warning "'FooClass' may not respond to 'barMethod'" should be emitted. Expect
the same behavior as for full #import. If s/@class FooClass;/#import "foo.h"/
mentioned warning is emitted.

Build & Platform:
clang version 3.0 (trunk 140001) on Mac OS X 10.6.8

Additional Builds:
Apple clang version 2.0 (tags/Apple/clang-139) (based on LLVM 2.9svn)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list