summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/category-1.m
blob: 40993e8762f6669c498f8bdc5b9d1612b2c6e4af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// RUN: clang -fsyntax-only -verify %s

@interface MyClass1 @end

@protocol p1,p2,p3;

@interface MyClass1 (Category1)  <p1> // expected-warning {{cannot find protocol definition for 'p1', referenced by 'Category1'}}
@end

@interface MyClass1 (Category1)  // expected-error {{duplicate interface declaration for category 'MyClass1(Category1)'}}
@end

@interface MyClass1 (Category3) 
@end

@interface MyClass1 (Category4) @end
@interface MyClass1 (Category5) @end
@interface MyClass1 (Category6) @end
@interface MyClass1 (Category7) @end
@interface MyClass1 (Category8) @end


@interface MyClass1 (Category4) @end // expected-error {{duplicate interface declaration for category 'MyClass1(Category4)'}}
@interface MyClass1 (Category7) @end // expected-error {{duplicate interface declaration for category 'MyClass1(Category7)'}}
@interface MyClass1 (Category8) @end // expected-error {{duplicate interface declaration for category 'MyClass1(Category8)'}}


@protocol p3 @end

@interface MyClass1 (Category) <p2, p3> @end  // expected-warning {{cannot find protocol definition for 'p2', referenced by 'Category'}}

@interface MyClass  (Category) @end // expected-error {{cannot find interface declaration for 'MyClass'}}

@class MyClass2;

@interface MyClass2  (Category) @end  // expected-error {{cannot find interface declaration for 'MyClass2'}}


OpenPOWER on IntegriCloud