Commit 26515aa9 by Ziemowit Laski Committed by Mike Stump

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