[cfe-dev] ObjC++ and MyObjCClass.class syntax

Fariborz Jahanian fjahanian at apple.com
Wed Aug 11 10:57:41 PDT 2010


Can you provide a test case. I see that in this case 'class' is  
supported as property name in objective-c mode (but not objective-c++).
g++ ObjC++  does not support it either.

@interface I
{
   int class;
}
@property int class;
@end

@implementation  I
- (int) Meth { I* Foo; return Foo.class; }
@end


% gcc -ObjC++ t.m
t.m:3: error: expected identifier before ';' token
t.m:5: error: expected identifier before ';' token
t.m: In function 'int -[I Meth](I*, objc_selector*)':
t.m:9: error: expected unqualified-id before 'class'
t.m:9: error: expected ';' before 'class'
- Fariborz


On Aug 11, 2010, at 9:40 AM, Jean-Daniel Dupas wrote:

> Hello,
>
> I would like to know if it is acceptable to add a special case in  
> the parser to support the Foo.class syntax in ObjC++ (where Foo is  
> an ObjC class).
> This syntax already works in classic ObjC, and is supported by GCC  
> in both ObjC and ObjC++. But actually, clang does not support it.
>
> Thanks
> <Class.class.patch>
>
>
> -- Jean-Daniel
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list