[LLVMbugs] [Bug 10791] New: Full ObjCInterfaceDecl declaration in header without import

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Aug 27 11:16:29 PDT 2011


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

           Summary: Full ObjCInterfaceDecl declaration in header without
                    import
           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=7162)
 --> (http://llvm.org/bugs/attachment.cgi?id=7162)
Archived mentioned in description files

When in .h file class is forward declared and in .m file class is imported,
full ObjCInterfaceDecl declaration is available in forward declaration
ObjCClassDecl.
Not sure if it is a bug, I've expected different from actual result.

STEPS TO REPRODUCE:
1) Build AST for foo.m, where files are like these (files are attached):

// imported_class.h
#import <objc/Object.h>

@interface ImportedClass : Object {}
@end

// imported_class.m
#import "imported_class.h"
@implementation ImportedClass
@end

// foo.h
#import <objc/Object.h>
@class ImportedClass;

@interface Foo : Object {
  ImportedClass *var;
}
@end

// foo.m
#import "foo.h"
#import "imported_class.h"

@implementation Foo
@end

2) Observe ObjCClassDecl for @class ImportedClass; in foo.h

ACTUAL RESULT:
ObjCClassDecl contains ObjCInterfaceDecl, which is not isForwardDecl(), has
LocStart, LocEnd pointing to imported_class.h

EXPECTED RESULT:
ObjCClassDecl should contain isForwardDecl() ObjCInterfaceDecl with LocStart
pointing to foo.h.
I think it should be expected because in foo.h ImportedClass isn't imported and
full declaration isn't visible.

Build & Platform:
Build from r138705 from trunk on Mac OS X 10.6.8. Though it doesn't look like
the issue is OS-specific.

-- 
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