summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/redecl-add-after-load.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-03-20 02:17:21 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-03-20 02:17:21 +0000
commit625ccb3f7897cb056c44808c6352d93378ac94a3 (patch)
treece4511d24f37c1ab9703410cb73f1e3a6fcbb98f /clang/test/Modules/redecl-add-after-load.cpp
parent41a1546ebcd07c27ac46bc9858159e7ba6532d1d (diff)
downloadbcm5719-llvm-625ccb3f7897cb056c44808c6352d93378ac94a3.tar.gz
bcm5719-llvm-625ccb3f7897cb056c44808c6352d93378ac94a3.zip
[modules] Remove some redundant work when building a lookup table for a DeclContext.
When we need to build the lookup table for a DeclContext, we used to pull in all lexical declarations for the context; instead, just build a lookup table for the local lexical declarations. We previously didn't guarantee that the imported declarations would be in the returned map, but in some cases we'd happen to put them all in there regardless. Now we're even lazier about this. This unnecessary work was papering over some other bugs: - LookupVisibleDecls would use the DC for name lookups in the TU in C, and this was not guaranteed to find all imported names (generally, the DC for the TU in C is not a reliable place to perform lookups). We now use an identifier-based lookup mechanism for this. - We didn't actually load in the list of eagerly-deserialized declarations when importing a module (so external definitions in a module wouldn't be emitted by users of those modules unless they happened to be deserialized by the user of the module). llvm-svn: 232793
Diffstat (limited to 'clang/test/Modules/redecl-add-after-load.cpp')
-rw-r--r--clang/test/Modules/redecl-add-after-load.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Modules/redecl-add-after-load.cpp b/clang/test/Modules/redecl-add-after-load.cpp
index 68deaf8b4ef..53e54c84cc3 100644
--- a/clang/test/Modules/redecl-add-after-load.cpp
+++ b/clang/test/Modules/redecl-add-after-load.cpp
@@ -29,7 +29,7 @@ struct D {
static constexpr int function(); // expected-note {{here}}
};
typedef D::A DB;
-constexpr int D_test(bool b) { return b ? D::variable : D::function(); } // expected-note {{subexpression}} expected-note {{undefined}}
+constexpr int D_test(bool b) { return b ? D::variable : D::function(); } // expected-note {{undefined}}
#endif
@import redecl_add_after_load;
@@ -54,6 +54,6 @@ constexpr int merged_struct_variable_test = D_test(true);
constexpr int merged_struct_function_test = D_test(false);
#ifndef IMPORT_DECLS
// expected-error@-4 {{incomplete}}
-// expected-error@-4 {{constant}} expected-note@-4 {{in call to}}
+// @-4: definition of D::variable must be emitted, so it gets imported eagerly
// expected-error@-4 {{constant}} expected-note@-4 {{in call to}}
#endif
OpenPOWER on IntegriCloud