annotate gcc/testsuite/objc.dg/comp-types-10.m @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 #include "../objc-obj-c++-shared/TestsuiteObject.h"
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 @protocol Foo
kono
parents:
diff changeset
6 - (id)meth1;
kono
parents:
diff changeset
7 - (id)meth2:(int)arg;
kono
parents:
diff changeset
8 @end
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 @interface Derived1: TestsuiteObject
kono
parents:
diff changeset
11 @end
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 @interface Derived2: TestsuiteObject
kono
parents:
diff changeset
14 + (Derived1 *)new;
kono
parents:
diff changeset
15 @end
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 id<Foo> func(void) {
kono
parents:
diff changeset
18 TestsuiteObject *o = [TestsuiteObject new];
kono
parents:
diff changeset
19 return o; /* { dg-warning "class .TestsuiteObject. does not implement the .Foo. protocol" } */
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 @implementation Derived2
kono
parents:
diff changeset
23 + (Derived1 *)new {
kono
parents:
diff changeset
24 Derived2 *o = [super new];
kono
parents:
diff changeset
25 return o; /* { dg-warning "distinct Objective\\-C type in return" } */
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27 @end