[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


           Summary: Full ObjCInterfaceDecl declaration in header without
           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
Not sure if it is a bug, I've expected different from actual result.

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

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

@interface ImportedClass : Object {}

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

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

@interface Foo : Object {
  ImportedClass *var;

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

@implementation Foo

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

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

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