In gcc/objc/: 2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/: 2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (objc_set_method_opt): Tidy up error messages. In particular, explicitly mention whether the error is due to the @optional or @required keyword instead of mentioning "@optional/@required". In gcc/testsuite/: 2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/enhanced-proto-2.m: Updated. * obj-c++.dg/enhanced-proto-2.mm: Updated. From-SVN: r168327
This commit is contained in:
parent
37153b1e07
commit
445eb4c664
5 changed files with 26 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
|||
2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* objc-act.c (objc_set_method_opt): Tidy up error messages. In
|
||||
particular, explicitly mention whether the error is due to the
|
||||
@optional or @required keyword instead of mentioning
|
||||
"@optional/@required".
|
||||
|
||||
2010-12-29 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
PR objc/47118
|
||||
|
|
|
@ -876,13 +876,21 @@ void
|
|||
objc_set_method_opt (bool optional)
|
||||
{
|
||||
if (flag_objc1_only)
|
||||
error_at (input_location, "@optional/@required are not available in Objective-C 1.0");
|
||||
{
|
||||
if (optional)
|
||||
error_at (input_location, "%<@optional%> is not available in Objective-C 1.0");
|
||||
else
|
||||
error_at (input_location, "%<@required%> is not available in Objective-C 1.0");
|
||||
}
|
||||
|
||||
objc_method_optional_flag = optional;
|
||||
if (!objc_interface_context
|
||||
|| TREE_CODE (objc_interface_context) != PROTOCOL_INTERFACE_TYPE)
|
||||
{
|
||||
error ("@optional/@required is allowed in @protocol context only");
|
||||
if (optional)
|
||||
error ("%<@optional%> is allowed in @protocol context only");
|
||||
else
|
||||
error ("%<@required%> is allowed in @protocol context only");
|
||||
objc_method_optional_flag = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* objc.dg/enhanced-proto-2.m: Updated.
|
||||
* obj-c++.dg/enhanced-proto-2.mm: Updated.
|
||||
|
||||
2010-12-29 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
PR objc/47118
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
@end
|
||||
|
||||
@interface MyProto2 <MyProto1>
|
||||
@required /* { dg-error "@optional/@required is allowed in @protocol context only" } */
|
||||
@required /* { dg-error ".@required. is allowed in @protocol context only" } */
|
||||
- (void) FOO2;
|
||||
@optional /* { dg-error "@optional/@required is allowed in @protocol context only" } */
|
||||
@optional /* { dg-error ".@optional. is allowed in @protocol context only" } */
|
||||
- (void) FOO3;
|
||||
@end
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
@end
|
||||
|
||||
@interface MyProto2 <MyProto1>
|
||||
@required /* { dg-error "@optional/@required is allowed in @protocol context only" } */
|
||||
@required /* { dg-error ".@required. is allowed in @protocol context only" } */
|
||||
- (void) FOO2;
|
||||
@optional /* { dg-error "@optional/@required is allowed in @protocol context only" } */
|
||||
@optional /* { dg-error ".@optional. is allowed in @protocol context only" } */
|
||||
- (void) FOO3;
|
||||
@end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue