diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-12-29 22:59:46 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-12-29 22:59:46 +0000 |
commit | 445eb4c6649ffc0088535467bdbdd43f3fb52b60 (patch) | |
tree | 813e3c540a815be58942b76d45bd84212900901e | |
parent | 37153b1e0743ba79cc6d86b92e843995ab015755 (diff) | |
download | gcc-445eb4c6649ffc0088535467bdbdd43f3fb52b60.zip gcc-445eb4c6649ffc0088535467bdbdd43f3fb52b60.tar.gz gcc-445eb4c6649ffc0088535467bdbdd43f3fb52b60.tar.bz2 |
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
-rw-r--r-- | gcc/objc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/obj-c++.dg/enhanced-proto-2.mm | 4 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/enhanced-proto-2.m | 4 |
5 files changed, 26 insertions, 6 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 5523829..562081b 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -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 diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 47f3fbc..bc959d6 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -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; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9019f79..a364a4e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/obj-c++.dg/enhanced-proto-2.mm b/gcc/testsuite/obj-c++.dg/enhanced-proto-2.mm index 4aacbda..31c2e50 100644 --- a/gcc/testsuite/obj-c++.dg/enhanced-proto-2.mm +++ b/gcc/testsuite/obj-c++.dg/enhanced-proto-2.mm @@ -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 diff --git a/gcc/testsuite/objc.dg/enhanced-proto-2.m b/gcc/testsuite/objc.dg/enhanced-proto-2.m index 6944ec8..c196b51 100644 --- a/gcc/testsuite/objc.dg/enhanced-proto-2.m +++ b/gcc/testsuite/objc.dg/enhanced-proto-2.m @@ -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 |