summaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg
diff options
context:
space:
mode:
authorzlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-28 02:01:08 +0000
committerzlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-28 02:01:08 +0000
commit0bee387e3c1aae76cc96f13a1b6f4180dec18e8a (patch)
tree4dc299720e3fd440e3139ea0c208910bedcceae5 /gcc/testsuite/objc.dg
parent1f096ecf54f5eb831a4a887306d28dab381c8554 (diff)
downloadgcc-0bee387e3c1aae76cc96f13a1b6f4180dec18e8a.tar.gz
[gcc/objc/ChangeLog]
2005-06-27 Ziemowit Laski <zlaski@apple.com> * objc-act.c (objc_build_struct): Save the TYPE_OBJC_INFO portion of TYPE_LANG_SPECIFIC info for all variants of a class before calling finish_struct(), and restore same TYPE_OBJC_INFO afterwards. [gcc/testsuite/ChangeLog] 2005-06-27 Ziemowit Laski <zlaski@apple.com> * obj-c++.dg/proto-lossage-5.mm: New. * objc.dg/proto-lossage-5.m: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/objc.dg')
-rw-r--r--gcc/testsuite/objc.dg/proto-lossage-5.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/proto-lossage-5.m b/gcc/testsuite/objc.dg/proto-lossage-5.m
new file mode 100644
index 00000000000..35c0956ed8e
--- /dev/null
+++ b/gcc/testsuite/objc.dg/proto-lossage-5.m
@@ -0,0 +1,22 @@
+/* Do not lose references to forward-declared protocols. */
+/* { dg-do compile } */
+@class MyBaseClass;
+@class MyClassThatFails;
+@protocol _MyProtocol;
+
+@interface MyClassThatFails
+- (MyBaseClass<_MyProtocol> *) aMethod;
+@end
+
+@interface MyBaseClass
+@end
+
+@protocol _MyProtocol
+@end
+
+@implementation MyClassThatFails
+- (MyBaseClass<_MyProtocol> *) aMethod
+{
+ return 0;
+}
+@end