Preserving locations for variable-uses and constants (PR c++/43486)
[official-gcc.git] / gcc / testsuite / objc.dg / comp-types-10.m
blobb95af5de1bc6cf1630f24ea506ff3217f2f8ca07
1 /* { dg-do compile } */
3 #include "../objc-obj-c++-shared/TestsuiteObject.h"
5 @protocol Foo
6 - (id)meth1;
7 - (id)meth2:(int)arg;
8 @end
10 @interface Derived1: TestsuiteObject
11 @end
13 @interface Derived2: TestsuiteObject
14 + (Derived1 *)new;
15 @end
17 id<Foo> func(void) {
18   TestsuiteObject *o = [TestsuiteObject new];
19   return o;  /* { dg-warning "class .TestsuiteObject. does not implement the .Foo. protocol" } */
22 @implementation Derived2
23 + (Derived1 *)new {
24   Derived2 *o = [super new];
25   return o;  /* { dg-warning "distinct Objective\\-C type in return" } */
27 @end