summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-02 17:18:37 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-02 17:18:37 +0000
commit5dbf4eb66b8f4ccdab028ebb79e51bbde6d06530 (patch)
treefa0eb0202f850e25f6964468e21e28a013008554 /clang/test
parent7610e45910c38e5ecc479619a53072d97369b8d2 (diff)
downloadbcm5719-llvm-5dbf4eb66b8f4ccdab028ebb79e51bbde6d06530.tar.gz
bcm5719-llvm-5dbf4eb66b8f4ccdab028ebb79e51bbde6d06530.zip
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. llvm-svn: 147436
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/def.h9
-rw-r--r--clang/test/Modules/decldef.mm17
2 files changed, 23 insertions, 3 deletions
diff --git a/clang/test/Modules/Inputs/def.h b/clang/test/Modules/Inputs/def.h
index c9bc36d61da..7c1a99ef7e6 100644
--- a/clang/test/Modules/Inputs/def.h
+++ b/clang/test/Modules/Inputs/def.h
@@ -1,4 +1,11 @@
-@interface A
+
+
+
+
+@interface A {
+@public
+ int ivar;
+}
@end
struct B {
diff --git a/clang/test/Modules/decldef.mm b/clang/test/Modules/decldef.mm
index 3d24a0ef533..07499b31f7e 100644
--- a/clang/test/Modules/decldef.mm
+++ b/clang/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.
}
OpenPOWER on IntegriCloud