[LLVMbugs] [Bug 2893] New: Parsing error (type of property does not match type of ivar ) if property conforms to protocol and ivar doesn't

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Oct 13 23:43:19 PDT 2008


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

           Summary: Parsing error (type of property does not match type of
                    ivar) if property conforms to protocol and ivar doesn't
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: parser
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nikita at zhuk.fi
                CC: llvmbugs at cs.uiuc.edu


The following test case produces clang parser error, but compiles without
warnings with GCC 4.0:

#import <Foundation/Foundation.h>

@protocol MyProtocol
- (NSString *)stringValue;
@end

@interface MyClass : NSObject {
  id  _myIvar;
}
@property (readwrite, retain) id<MyProtocol> myIvar;
@end

@implementation MyClass
@synthesize myIvar = _myIvar;
@end

/tmp/iVarProtTest/MyClass.m:22:13: error: type of property 'myIvar'  does not
match type of ivar '_myIvar'
@synthesize myIvar = _myIvar;
            ^
1 diagnostic generated.


However, when the property is changed from:
@property (readwrite, retain)
to:
@property (readonly)

then this error goes away.

I'm not completely sure if this is intended behavior or not. However, since GCC
doesn't give any warnings about this, I assume that this could be something you
might be interested in.

Clang revision: 57479


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