Diagnose cases where the definition of a particular type is required,
is known (to Clang), but is not visible because the module has not yet
been imported.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147436 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Modules/decldef.mm b/test/Modules/decldef.mm
index 3d24a0e..07499b3 100644
--- a/test/Modules/decldef.mm
+++ b/test/Modules/decldef.mm
@@ -1,15 +1,28 @@
 // RUN: rm -rf %t
 // RUN: %clang_cc1 -I %S/Inputs -fmodule-cache-path %t %s -verify
 
+
+// in other file: expected-note{{previous definition is here}}
+
+
+
+
+
+// in other file: expected-note{{previous definition is here}}
+
 __import_module__ decldef;
 A *a1; // expected-error{{unknown type name 'A'}}
 B *b1; // expected-error{{unknown type name 'B'}}
-
 __import_module__ decldef.Decl;
 
 A *a2;
 B *b;
 
+void testA(A *a) {
+  a->ivar = 17; // expected-error{{definition of 'A' must be imported before it is required}}
+}
+
 void testB() {
-  B b; // FIXME: Should error, because we can't see the definition.
+  B b; // expected-error{{definition of 'B' must be imported before it is required}}
+  B b2; // Note: the reundant error was silenced.
 }