Yet more Objective-C++...
* objc.dg/method-5.m: Update. * objc.dg/method-6.m: Update. * objc.dg/method-7.m: Update. * objc.dg/method-9.m: Update. * objc.dg/try-catch-2.m: Update. From-SVN: r99851
This commit is contained in:
parent
38965eb29c
commit
26515aa9df
6 changed files with 35 additions and 20 deletions
|
@ -1,3 +1,13 @@
|
|||
2005-05-17 Mike Stump <mrs@apple.com>
|
||||
|
||||
Yet more Objective-C++...
|
||||
|
||||
* objc.dg/method-5.m: Update.
|
||||
* objc.dg/method-6.m: Update.
|
||||
* objc.dg/method-7.m: Update.
|
||||
* objc.dg/method-9.m: Update.
|
||||
* objc.dg/try-catch-2.m: Update.
|
||||
|
||||
2005-05-17 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* gcc.dg/compat/struct-layout-1_generate.c (iterative_hash):
|
||||
|
|
|
@ -11,8 +11,8 @@ void foo(UnderSpecified *u, NotAClass *n) {
|
|||
[n nonexistent_method]; /* { dg-warning "invalid receiver type" } */
|
||||
/* { dg-warning "no .\\-nonexistent_method. method found" "" { target *-*-* } 11 } */
|
||||
[NotAClass nonexistent_method]; /* { dg-error ".NotAClass. is not an Objective\\-C class name or alias" } */
|
||||
[u nonexistent_method]; /* { dg-warning ".UnderSpecified. may not respond to .\\-nonexistent_method." } */
|
||||
[UnderSpecified nonexistent_method]; /* { dg-warning ".UnderSpecified. may not respond to .\\+nonexistent_method." } */
|
||||
[u nonexistent_method]; /* { dg-warning "no .\\-nonexistent_method. method found" } */
|
||||
[UnderSpecified nonexistent_method]; /* { dg-warning "no .\\+nonexistent_method. method found" } */
|
||||
}
|
||||
|
||||
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 0 } */
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
unless they reside in root classes. */
|
||||
/* Author: Ziemowit Laski <zlaski@apple.com> */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wstrict-selector-match" } */
|
||||
|
||||
#include <objc/Protocol.h>
|
||||
|
||||
|
@ -19,13 +20,13 @@ void foo(void) {
|
|||
Class receiver;
|
||||
|
||||
[receiver port]; /* { dg-warning "multiple methods named .\\+port. found" } */
|
||||
/* { dg-warning "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 9 } */
|
||||
/* { dg-warning "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 14 } */
|
||||
/* { dg-warning "using .\\-\\(unsigned( int)?\\)port." "" { target *-*-* } 10 } */
|
||||
/* { dg-warning "also found .\\+\\(Protocol \\*\\)port." "" { target *-*-* } 15 } */
|
||||
|
||||
[receiver starboard]; /* { dg-warning "no .\\+starboard. method found" } */
|
||||
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 25 } */
|
||||
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 25 } */
|
||||
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 25 } */
|
||||
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 26 } */
|
||||
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 26 } */
|
||||
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 26 } */
|
||||
|
||||
[Class port]; /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* Check if finding multiple signatures for a method is handled gracefully. */
|
||||
/* Author: Ziemowit Laski <zlaski@apple.com> */
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wstrict-selector-match" } */
|
||||
|
||||
#include <objc/Object.h>
|
||||
|
||||
|
@ -16,12 +18,12 @@ id foo(void) {
|
|||
Object *obj = [[Object alloc] init];
|
||||
id obj2 = obj;
|
||||
[obj setWindow:nil]; /* { dg-warning ".Object. may not respond to .\\-setWindow:." } */
|
||||
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 18 } */
|
||||
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 18 } */
|
||||
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 18 } */
|
||||
/* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 20 } */
|
||||
/* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 20 } */
|
||||
/* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 20 } */
|
||||
[obj2 setWindow:nil]; /* { dg-warning "multiple methods named .\\-setWindow:. found" } */
|
||||
/* { dg-warning "using .\\-\\(void\\)setWindow:\\(Object \\*\\)wdw." "" { target *-*-* } 8 } */
|
||||
/* { dg-warning "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } 12 } */
|
||||
/* { dg-warning "using .\\-\\(void\\)setWindow:\\(Object \\*\\)wdw." "" { target *-*-* } 10 } */
|
||||
/* { dg-warning "also found .\\-\\(void\\)setWindow:\\(Class1 \\*\\)window." "" { target *-*-* } 14 } */
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/* Check if finding multiple signatures for a method is handled gracefully
|
||||
when method lookup succeeds (see also method-7.m). */
|
||||
/* Contributed by Ziemowit Laski <zlaski@apple.com> */
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wstrict-selector-match" } */
|
||||
|
||||
#include <objc/Object.h>
|
||||
|
||||
|
@ -31,13 +33,13 @@
|
|||
+ (NTGridDataObject*)dataObject:(id<MyObject, MyCoding>)data
|
||||
{
|
||||
NTGridDataObject *result = [[NTGridDataObject alloc] initWithData:data];
|
||||
/* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } 33 } */
|
||||
/* { dg-warning "using .\\-\\(id\\)initWithData:\\(Object \\*\\)data." "" { target *-*-* } 9 } */
|
||||
/* { dg-warning "also found .\\-\\(id\\)initWithData:\\(id <MyObject, MyCoding>\\)data." "" { target *-*-* } 17 } */
|
||||
/* { dg-warning "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } 13 } */
|
||||
/* { dg-warning "multiple methods named .\\-initWithData:. found" "" { target *-*-* } 35 } */
|
||||
/* { dg-warning "using .\\-\\(id\\)initWithData:\\(Object \\*\\)data." "" { target *-*-* } 11 } */
|
||||
/* { dg-warning "also found .\\-\\(id\\)initWithData:\\(id <MyObject, MyCoding>\\)data." "" { target *-*-* } 19 } */
|
||||
/* { dg-warning "also found .\\-\\(id\\)initWithData:\\(int\\)data." "" { target *-*-* } 15 } */
|
||||
|
||||
/* The following warning is a consequence of picking the "wrong" method signature. */
|
||||
/* { dg-warning "passing argument 1 of .initWithData:. from incompatible pointer type" "" { target *-*-* } 33 } */
|
||||
/* The following warning is a consequence of picking the "wrong" method signature. */
|
||||
/* { dg-warning "passing argument 1 of .initWithData:. from incompatible pointer type" "" { target *-*-* } 35 } */
|
||||
return result;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Test out '@catch(id foo) {...}', which should catch
|
||||
all uncaught exceptions. */
|
||||
/* Test out '@catch(id foo) {...}', which should catch all uncaught
|
||||
exceptions. */
|
||||
/* Developed by Ziemowit Laski <zlaski@apple.com>. */
|
||||
|
||||
/* { dg-options "-fobjc-exceptions" } */
|
||||
|
|
Loading…
Add table
Reference in a new issue