2011-12-15 00:03:29 +08:00
|
|
|
// RUN: rm -rf %t
|
2012-01-04 02:24:14 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules -I %S/Inputs -fmodule-cache-path %t %s -verify
|
2011-12-15 00:03:29 +08:00
|
|
|
|
2012-01-03 01:18:37 +08:00
|
|
|
|
|
|
|
// in other file: expected-note{{previous definition is here}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// in other file: expected-note{{previous definition is here}}
|
|
|
|
|
2012-03-02 06:07:04 +08:00
|
|
|
@__experimental_modules_import decldef;
|
2011-12-15 00:03:29 +08:00
|
|
|
A *a1; // expected-error{{unknown type name 'A'}}
|
|
|
|
B *b1; // expected-error{{unknown type name 'B'}}
|
2012-03-02 06:07:04 +08:00
|
|
|
@__experimental_modules_import decldef.Decl;
|
2011-12-15 00:03:29 +08:00
|
|
|
|
2011-12-16 04:36:27 +08:00
|
|
|
A *a2;
|
2011-12-15 00:03:29 +08:00
|
|
|
B *b;
|
|
|
|
|
2012-01-03 01:18:37 +08:00
|
|
|
void testA(A *a) {
|
|
|
|
a->ivar = 17; // expected-error{{definition of 'A' must be imported before it is required}}
|
|
|
|
}
|
|
|
|
|
2011-12-15 00:03:29 +08:00
|
|
|
void testB() {
|
2012-01-03 01:18:37 +08:00
|
|
|
B b; // expected-error{{definition of 'B' must be imported before it is required}}
|
|
|
|
B b2; // Note: the reundant error was silenced.
|
2011-12-15 00:03:29 +08:00
|
|
|
}
|