summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-12 01:29:50 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-12 01:29:50 +0000
commitc147b0bc31cbce36167dc04ca82c050362cf0378 (patch)
tree58d7b59c41c336a20bbd1d0f9cd163241ef19de6 /clang/test/Modules
parent4a5030c72f6bd0a36e11d48c5c95b98dfee67164 (diff)
downloadbcm5719-llvm-c147b0bc31cbce36167dc04ca82c050362cf0378.tar.gz
bcm5719-llvm-c147b0bc31cbce36167dc04ca82c050362cf0378.zip
Provide Decl::getOwningModule(), which determines the (sub)module in
which a particular declaration resides. Use this information to customize the "definition of 'blah' must be imported from another module" diagnostic with the module the user actually has to import. Additionally, recover by importing that module, so we don't complain about other names in that module. Still TODO: coming up with decent Fix-Its for these cases, and expand this recovery approach for other name lookup failures. llvm-svn: 172290
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/decldef.mm13
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/test/Modules/decldef.mm b/clang/test/Modules/decldef.mm
index c99fdea0d84..e164aa7e080 100644
--- a/clang/test/Modules/decldef.mm
+++ b/clang/test/Modules/decldef.mm
@@ -2,13 +2,7 @@
// RUN: %clang_cc1 -fmodules -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}}
+// In other file: expected-note {{previous definition is here}}
@import decldef;
A *a1; // expected-error{{unknown type name 'A'}}
@@ -19,10 +13,9 @@ A *a2;
B *b;
void testA(A *a) {
- a->ivar = 17; // expected-error{{definition of 'A' must be imported before it is required}}
+ a->ivar = 17; // expected-error{{definition of 'A' must be imported from module 'decldef.Def' before it is required}}
}
void testB() {
- B b; // expected-error{{definition of 'B' must be imported before it is required}}
- B b2; // Note: the reundant error was silenced.
+ B b; // Note: redundant error silenced
}
OpenPOWER on IntegriCloud