• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: rm -rf %t
2// RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify
3
4// expected-note@Inputs/def.h:5 {{previous definition is here}}
5
6@class Def;
7Def *def;
8class Def2;
9Def2 *def2;
10
11@interface Unrelated
12- defMethod;
13@end
14
15@import decldef;
16A *a1; // expected-error{{unknown type name 'A'}}
17B *b1; // expected-error{{unknown type name 'B'}}
18@import decldef.Decl;
19
20A *a2;
21B *b;
22
23void testA(A *a) {
24  a->ivar = 17; // expected-error{{definition of 'A' must be imported from module 'decldef.Def' before it is required}}
25}
26
27void testB() {
28  B b; // Note: redundant error silenced
29}
30
31void testDef() {
32  [def defMethod];
33}
34
35void testDef2() {
36  def2->func();
37}
38