tree.c (get_qualified_type): Add TYPE_CONTEXT check.
2002-08-20 Devang Patel <dpatel@apple.com> * tree.c (get_qualified_type): Add TYPE_CONTEXT check. testsuite: * objc.dg/proto-hier-2.m: New test. From-SVN: r56475
This commit is contained in:
parent
a5aa74218f
commit
92b5aacd33
4 changed files with 57 additions and 1 deletions
|
@ -1,3 +1,6 @@
|
|||
2002-08-20 Devang Patel <dpatel@apple.com>
|
||||
* tree.c (get_qualified_type): Add TYPE_CONTEXT check.
|
||||
|
||||
2002-08-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* arc.c (output_shift): Use stdio instead of asm_fprintf.
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
2002-08-20 Devang Patel <dpatel@apple.com>
|
||||
* objc.dg/proto-hier-2.m: New test.
|
||||
|
||||
2002-08-19 Ziemowit Laski <zlaski@apple.com>
|
||||
|
||||
* objc.dg/bitfield-1.m: New test.
|
||||
|
|
49
gcc/testsuite/objc.dg/proto-hier-2.m
Normal file
49
gcc/testsuite/objc.dg/proto-hier-2.m
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* Test protocol warning. */
|
||||
/* Contributed by Devang Patel <dpatel@apple.com>. */
|
||||
/* { dg-do compile } */
|
||||
|
||||
typedef struct objc_object { struct objc_class *class_pointer; } *id;
|
||||
|
||||
@protocol Bar
|
||||
@end
|
||||
|
||||
id <Bar> Foo_Bar () { }
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int i;
|
||||
} MyStruct;
|
||||
|
||||
@interface Foo
|
||||
{
|
||||
id _mainData;
|
||||
MyStruct *_anotherData;
|
||||
}
|
||||
|
||||
-(id) mainDataSource;
|
||||
-(id) anotherDataSource;
|
||||
-(id) my_method: (int) i;
|
||||
@end
|
||||
|
||||
@implementation Foo
|
||||
-(id) anotherDataSource
|
||||
{
|
||||
return (id)_anotherData;
|
||||
}
|
||||
|
||||
-(id) mainDataSource
|
||||
{
|
||||
return _mainData;
|
||||
}
|
||||
|
||||
-(id) my_method: (int) i
|
||||
{
|
||||
id one = [self anotherDataSource];
|
||||
|
||||
i = i - 1;
|
||||
// Do not issue warning about my_method not implemented by protocol
|
||||
return [(one ? [self mainDataSource] : one) my_method:i];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -2832,7 +2832,8 @@ get_qualified_type (type, type_quals)
|
|||
like the one we need to have. If so, use that existing one. We must
|
||||
preserve the TYPE_NAME, since there is code that depends on this. */
|
||||
for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
|
||||
if (TYPE_QUALS (t) == type_quals && TYPE_NAME (t) == TYPE_NAME (type))
|
||||
if (TYPE_QUALS (t) == type_quals && TYPE_NAME (t) == TYPE_NAME (type)
|
||||
&& TYPE_CONTEXT (t) == TYPE_CONTEXT (type))
|
||||
return t;
|
||||
|
||||
return NULL_TREE;
|
||||
|
|
Loading…
Add table
Reference in a new issue