2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2007-10-04 08:22:33 +08:00
|
|
|
|
2007-09-22 08:01:35 +08:00
|
|
|
@interface MyClass1 @end
|
|
|
|
|
|
|
|
@protocol p1,p2,p3;
|
|
|
|
|
2008-11-24 06:38:38 +08:00
|
|
|
@interface MyClass1 (Category1) <p1> // expected-warning {{cannot find protocol definition for 'p1'}} expected-note {{previous definition is here}}
|
2007-09-22 08:01:35 +08:00
|
|
|
@end
|
|
|
|
|
2008-11-24 06:38:38 +08:00
|
|
|
@interface MyClass1 (Category1) // expected-warning {{duplicate definition of category 'Category1' on interface 'MyClass1'}}
|
2007-09-22 08:01:35 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface MyClass1 (Category3)
|
|
|
|
@end
|
|
|
|
|
2008-11-24 06:38:38 +08:00
|
|
|
@interface MyClass1 (Category4) @end // expected-note {{previous definition is here}}
|
2007-09-22 08:01:35 +08:00
|
|
|
@interface MyClass1 (Category5) @end
|
|
|
|
@interface MyClass1 (Category6) @end
|
2008-11-24 06:38:38 +08:00
|
|
|
@interface MyClass1 (Category7) @end // expected-note {{previous definition is here}}
|
|
|
|
@interface MyClass1 (Category8) @end // expected-note {{previous definition is here}}
|
2007-09-22 08:01:35 +08:00
|
|
|
|
|
|
|
|
2008-11-24 06:38:38 +08:00
|
|
|
@interface MyClass1 (Category4) @end // expected-warning {{duplicate definition of category 'Category4' on interface 'MyClass1'}}
|
|
|
|
@interface MyClass1 (Category7) @end // expected-warning {{duplicate definition of category 'Category7' on interface 'MyClass1'}}
|
|
|
|
@interface MyClass1 (Category8) @end // expected-warning {{duplicate definition of category 'Category8' on interface 'MyClass1'}}
|
2007-09-22 08:01:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
@protocol p3 @end
|
|
|
|
|
2008-07-26 11:47:43 +08:00
|
|
|
@interface MyClass1 (Category) <p2, p3> @end // expected-warning {{cannot find protocol definition for 'p2'}}
|
2007-09-22 08:01:35 +08:00
|
|
|
|
2010-01-04 02:01:57 +08:00
|
|
|
@interface UnknownClass (Category) @end // expected-error {{cannot find interface declaration for 'UnknownClass'}}
|
2007-09-22 08:01:35 +08:00
|
|
|
|
|
|
|
@class MyClass2;
|
|
|
|
|
|
|
|
@interface MyClass2 (Category) @end // expected-error {{cannot find interface declaration for 'MyClass2'}}
|
|
|
|
|
2008-06-05 12:33:44 +08:00
|
|
|
@interface XCRemoteComputerManager
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface XCRemoteComputerManager()
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface XCRemoteComputerManager()
|
|
|
|
@end
|
|
|
|
|
2008-11-24 06:38:38 +08:00
|
|
|
@interface XCRemoteComputerManager(x) // expected-note {{previous definition is here}}
|
2008-06-05 12:33:44 +08:00
|
|
|
@end
|
|
|
|
|
2008-11-24 06:38:38 +08:00
|
|
|
@interface XCRemoteComputerManager(x) // expected-warning {{duplicate definition of category 'x' on interface 'XCRemoteComputerManager'}}
|
2008-06-05 12:33:44 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation XCRemoteComputerManager
|
|
|
|
@end
|
|
|
|
|
2009-07-21 08:05:53 +08:00
|
|
|
@implementation XCRemoteComputerManager(x) // expected-note {{previous definition is here}}
|
|
|
|
@end
|
2007-09-22 08:01:35 +08:00
|
|
|
|
2009-07-21 08:05:53 +08:00
|
|
|
@implementation XCRemoteComputerManager(x) // expected-error {{reimplementation of category 'x' for class 'XCRemoteComputerManager'}}
|
|
|
|
@end
|
2009-09-30 02:51:43 +08:00
|
|
|
|
|
|
|
// <rdar://problem/7249233>
|
|
|
|
|
|
|
|
@protocol MultipleCat_P
|
2010-04-01 02:23:33 +08:00
|
|
|
-(void) im0; // expected-warning {{method in protocol not implemented [-Wprotocol]}}
|
2009-09-30 02:51:43 +08:00
|
|
|
@end
|
|
|
|
|
2010-03-28 03:02:17 +08:00
|
|
|
@interface MultipleCat_I @end // expected-note {{required for direct or indirect protocol 'MultipleCat_P'}}
|
2009-09-30 02:51:43 +08:00
|
|
|
|
|
|
|
@interface MultipleCat_I() @end
|
|
|
|
|
|
|
|
@interface MultipleCat_I() <MultipleCat_P> @end
|
|
|
|
|
2010-03-28 03:02:17 +08:00
|
|
|
@implementation MultipleCat_I // expected-warning {{incomplete implementation}}
|
2009-09-30 02:51:43 +08:00
|
|
|
@end
|
2010-02-24 03:39:46 +08:00
|
|
|
|
|
|
|
// <rdar://problem/7680391> - Handle nameless categories with no name that refer
|
|
|
|
// to an undefined class
|
|
|
|
@interface RDar7680391 () @end // expected-error{{cannot find interface declaration}}
|