]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR objc/18408 (ICE compiling code that involves casting classes)
authorAlexander Malmberg <alexander@malmberg.org>
Tue, 25 Jan 2005 03:16:48 +0000 (03:16 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 25 Jan 2005 03:16:48 +0000 (19:16 -0800)
2005-01-25  Alexander Malmberg  <alexander@malmberg.org>

        PR objc/18408
        * objc.dg/comp-types-7.m: New test.

From-SVN: r94200

gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/comp-types-7.m [new file with mode: 0644]

index 5b64d1461551d9b775cd47fc01c55379ab75139d..537cd207eeb8a107e37fe05e77dffd160658670f 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-25  Alexander Malmberg  <alexander@malmberg.org>
+
+       PR objc/18408
+       * objc.dg/comp-types-7.m: New test.
+
 2005-01-24  Janis Johnson  <janis187@us.ibm.com>
 
        * lib/target-supports.exp (current_target_name): New.
diff --git a/gcc/testsuite/objc.dg/comp-types-7.m b/gcc/testsuite/objc.dg/comp-types-7.m
new file mode 100644 (file)
index 0000000..c33600c
--- /dev/null
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* We just to ICE because we removed the cast to List_linked*
+   in -[ListIndex_linked next]. */
+
+@interface List
+{
+@public
+  int firstLink;
+}
+@end
+
+@interface ListIndex_linked
+{
+@public
+  List *collection;
+  int link;
+}
+@end
+
+@interface List_linked: List
+@end
+
+@implementation List
+@end
+
+@implementation ListIndex_linked
+- next
+{
+   link = ((List_linked*)collection)->firstLink;
+}
+@end
+