Commit 92b5aacd by Devang Patel Committed by Devang Patel

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
parent a5aa7421
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> 2002-08-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* arc.c (output_shift): Use stdio instead of asm_fprintf. * arc.c (output_shift): Use stdio instead of asm_fprintf.
......
2002-08-20 Devang Patel <dpatel@apple.com>
* objc.dg/proto-hier-2.m: New test.
2002-08-19 Ziemowit Laski <zlaski@apple.com> 2002-08-19 Ziemowit Laski <zlaski@apple.com>
* objc.dg/bitfield-1.m: New test. * objc.dg/bitfield-1.m: New test.
......
/* 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) ...@@ -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 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. */ preserve the TYPE_NAME, since there is code that depends on this. */
for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t)) 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 t;
return NULL_TREE; return NULL_TREE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment