public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug objc/47076] Protocol referenced in @interface declarations should be defined
2010-12-28 16:30 [Bug objc/47076] New: Protocol referenced in @interface declarations should be defined nicola at gcc dot gnu.org
@ 2010-12-28 16:30 ` nicola at gcc dot gnu.org
2010-12-29 1:17 ` nicola at gcc dot gnu.org
2010-12-29 15:32 ` nicola at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-12-28 16:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47076
Nicola Pero <nicola at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.12.28 16:30:49
Ever Confirmed|0 |1
--- Comment #1 from Nicola Pero <nicola at gcc dot gnu.org> 2010-12-28 16:30:49 UTC ---
Confirmed
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug objc/47076] New: Protocol referenced in @interface declarations should be defined
@ 2010-12-28 16:30 nicola at gcc dot gnu.org
2010-12-28 16:30 ` [Bug objc/47076] " nicola at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-12-28 16:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47076
Summary: Protocol referenced in @interface declarations should
be defined
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: objc
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: nicola@gcc.gnu.org
All the protocols in the list of protocols in an @interface declaration should
have been defined; forward-references are not enough. Here is a testcase --
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010.
*/
/* { dg-do compile } */
/* Test that all protocols appearing in @interface declarations are
real (ie, we saw a full @protocol definition with list of methods),
and not just forward-references (ie, "@protocol NSObject;"). */
#include <objc/objc.h>
@protocol MyProtocol;
@protocol MyProtocol2
- (int)method2;
@end
@interface MyClass <MyProtocol> /* { dg-warning "definition of protocol
.MyProtocol. not found" } */
@end
@interface MyClass2 <MyProtocol2> /* Ok */
@end
@interface MyClass2 (Category) <MyProtocol> /* { dg-warning "definition of
protocol .MyProtocol. not found" } */
@end
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug objc/47076] Protocol referenced in @interface declarations should be defined
2010-12-28 16:30 [Bug objc/47076] New: Protocol referenced in @interface declarations should be defined nicola at gcc dot gnu.org
2010-12-28 16:30 ` [Bug objc/47076] " nicola at gcc dot gnu.org
@ 2010-12-29 1:17 ` nicola at gcc dot gnu.org
2010-12-29 15:32 ` nicola at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-12-29 1:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47076
--- Comment #2 from Nicola Pero <nicola at gcc dot gnu.org> 2010-12-29 01:16:59 UTC ---
Author: nicola
Date: Wed Dec 29 01:16:55 2010
New Revision: 168307
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168307
Log:
In gcc/objc/:
2010-12-28 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/47076
* objc-act.c (lookup_protocol): Added 'definition_required'
argument. If 'definition_required', and the protocol is not
defined, emit a warning.
(objc_declare_protocols): Updated call to lookup_protocol.
(start_protocol): Same change.
(check_protocol_recursively): Same change.
(objc_build_protocol_expr): Same change.
(lookup_and_install_protocols): Added definition_required argument.
Pass it to lookup_protocol.
(objc_get_protocol_qualified_type): Updated call to
lookup_and_install_protocols.
(start_class): Updated calls to lookup_and_install_protocols; pass
true to 'definition_required' to get the warnings.
(start_protocol): Updated calls to lookup_and_install_protocols.
In gcc/testsuite/:
2010-12-28 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/47076
* objc.dg/protocol-forward-1.m: New.
* obj-c++.dg/protocol-forward-1.mm: New.
* objc.dg/attributes/proto-attribute-2.m: Updated.
* objc.dg/class-protocol-1.m: Updated.
* obj-c++.dg/attributes/proto-attribute-2.mm: Updated.
* obj-c++.dg/class-protocol-1.mm: Updated.
Added:
trunk/gcc/testsuite/obj-c++.dg/protocol-forward-1.mm
trunk/gcc/testsuite/objc.dg/protocol-forward-1.m
Modified:
trunk/gcc/objc/ChangeLog
trunk/gcc/objc/objc-act.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-2.mm
trunk/gcc/testsuite/obj-c++.dg/class-protocol-1.mm
trunk/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m
trunk/gcc/testsuite/objc.dg/class-protocol-1.m
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug objc/47076] Protocol referenced in @interface declarations should be defined
2010-12-28 16:30 [Bug objc/47076] New: Protocol referenced in @interface declarations should be defined nicola at gcc dot gnu.org
2010-12-28 16:30 ` [Bug objc/47076] " nicola at gcc dot gnu.org
2010-12-29 1:17 ` nicola at gcc dot gnu.org
@ 2010-12-29 15:32 ` nicola at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: nicola at gcc dot gnu.org @ 2010-12-29 15:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47076
Nicola Pero <nicola at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Known to work| |4.6.0
Resolution| |FIXED
Target Milestone|--- |4.6.0
--- Comment #3 from Nicola Pero <nicola at gcc dot gnu.org> 2010-12-29 15:32:10 UTC ---
Fixed in trunk.
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-29 15:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-28 16:30 [Bug objc/47076] New: Protocol referenced in @interface declarations should be defined nicola at gcc dot gnu.org
2010-12-28 16:30 ` [Bug objc/47076] " nicola at gcc dot gnu.org
2010-12-29 1:17 ` nicola at gcc dot gnu.org
2010-12-29 15:32 ` nicola at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).