It was brought to my attention our Objective-C 2.0 dot-syntax implementation for accessors didn't work with class names (eg, NSObject.class). :-( Class names are tricky because they normally start a declaration, but in this context we need to accept them as starting the Objective-C 2.0 dot-syntax, which we didn't. This patches fixes this for both Objective-C and Objective-C++. 4 testcases are included. Ok to commit ? Thanks In gcc/: 2010-11-04 Nicola Pero Fixed using the Objective-C 2.0 dot-syntax with class names. * c-parser.c (c_parser_next_token_starts_declspecs): In Objective-C, detect Objective-C 2.0 dot-syntax with a class name. (c_parser_next_token_starts_declaration): Same. (c_parser_postfix_expression): Parse the Objective-C 2.0 dot-syntax with a class name. In gcc/cp/: 2010-11-04 Nicola Pero Fixed using the Objective-C 2.0 dot-syntax with class names. * parser.c (cp_parser_primary_expression): Recognize Objective-C 2.0 dot-syntax with class names and process it. (cp_parser_nonclass_name): Recognize Objective-C 2.0 dot-syntax with class names. (cp_parser_class_name): Same change. (cp_parser_simple_type_specifier): Tidied comments. In gcc/c-family/: 2010-11-04 Nicola Pero Fixed using the Objective-C 2.0 dot-syntax with class names. * c-common.h (objc_build_class_component_ref): New. * stub-objc.c (objc_build_class_component_ref): New. In gcc/objc/: 2010-11-04 Nicola Pero Fixed using the Objective-C 2.0 dot-syntax with class names. * objc-act.c (objc_build_class_component_ref): New. In gcc/testsuite/: 2010-11-04 Nicola Pero Fixed using the Objective-C 2.0 dot-syntax with class names. * objc.dg/property/dotsyntax-3.m: New. * objc.dg/property/dotsyntax-4.m: New. * obj-c++.dg/property/dotsyntax-3.mm: New. * obj-c++.dg/property/dotsyntax-4.mm: New. * objc.dg/fobjc-std-1.m: Added test for warnings when the Objective-C 2.0 dot-syntax is used with class names. * obj-c++.dg/fobjc-std-1.mm: Same change.