summaryrefslogtreecommitdiffstats
path: root/test/SemaObjCXX/objc-extern-c.mm
blob: 6bd37610ae43ef61c7683b8239b900f8a5dc38d3 (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
// RUN: %clang_cc1 -fsyntax-only -verify %s

@protocol P // expected-note {{previous}}
-(void)meth1;
@end

@interface I // expected-note {{previous}}
@end

@interface I2
@end
@interface I2(C) // expected-note {{previous}}
@end

extern "C" {
@protocol P // expected-warning {{duplicate protocol definition of 'P' is ignored}}
-(void)meth2;
@end

@interface I // expected-error {{duplicate}}
@end

@interface I2(C) // expected-warning {{duplicate}}
@end
}

void test(id<P> p) {
  [p meth1];
  [p meth2]; // expected-warning {{not found}}
}