2011-12-15 00:03:29 +08:00
|
|
|
// RUN: rm -rf %t
|
2013-02-08 03:01:24 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules -I %S/Inputs -fmodules-cache-path=%t %s -verify
|
2011-12-15 00:03:29 +08:00
|
|
|
|
2012-01-03 01:18:37 +08:00
|
|
|
|
2013-01-12 09:29:50 +08:00
|
|
|
// In other file: expected-note {{previous definition is here}}
|
2012-01-03 01:18:37 +08:00
|
|
|
|
2012-12-12 06:11:52 +08:00
|
|
|
@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-12-12 06:11:52 +08:00
|
|
|
@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) {
|
2013-01-12 09:29:50 +08:00
|
|
|
a->ivar = 17; // expected-error{{definition of 'A' must be imported from module 'decldef.Def' before it is required}}
|
2012-01-03 01:18:37 +08:00
|
|
|
}
|
|
|
|
|
2011-12-15 00:03:29 +08:00
|
|
|
void testB() {
|
2013-01-12 09:29:50 +08:00
|
|
|
B b; // Note: redundant error silenced
|
2011-12-15 00:03:29 +08:00
|
|
|
}
|