summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExternalASTMerger.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2017-06-17 00:12:38 +0000
committerLang Hames <lhames@gmail.com>2017-06-17 00:12:38 +0000
commit8ca265f4a1a4ee4a875f4e2a19062127bb385b6a (patch)
tree10c216e5ace3d8906284de0c88ff37ffbb9ccfde /clang/lib/AST/ExternalASTMerger.cpp
parent64f94fe02a172d44dc920e4d2ab80779eaa1f99f (diff)
downloadbcm5719-llvm-8ca265f4a1a4ee4a875f4e2a19062127bb385b6a.tar.gz
bcm5719-llvm-8ca265f4a1a4ee4a875f4e2a19062127bb385b6a.zip
Call setMustBuildLookupTable on TagDecls in ExternalASTMerger
Summary: setMustBuildLookupTable should be called on imported TagDecls otherwise we may fail to import their member decls (if they have any). Not calling the setMustBuildLookupTable method results in a failure in the attached test case when lookup for the 'x' member fails on struct S, which hasn't had its decls imported elsewhere. (By contrast the member-in-struct testcase hasn't run into this issue because the import of its decls is triggered when the struct instance is defined, and the member access follows this). Reviewers: spyffe, rsmith Reviewed By: spyffe, rsmith Differential Revision: https://reviews.llvm.org/D34253 llvm-svn: 305619
Diffstat (limited to 'clang/lib/AST/ExternalASTMerger.cpp')
-rw-r--r--clang/lib/AST/ExternalASTMerger.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/AST/ExternalASTMerger.cpp b/clang/lib/AST/ExternalASTMerger.cpp
index 1dc472a5f75..b746edaf643 100644
--- a/clang/lib/AST/ExternalASTMerger.cpp
+++ b/clang/lib/AST/ExternalASTMerger.cpp
@@ -41,6 +41,7 @@ public:
Decl *Imported(Decl *From, Decl *To) override {
if (auto ToTag = dyn_cast<TagDecl>(To)) {
ToTag->setHasExternalLexicalStorage();
+ ToTag->setMustBuildLookupTable();
} else if (auto ToNamespace = dyn_cast<NamespaceDecl>(To)) {
ToNamespace->setHasExternalVisibleStorage();
}
OpenPOWER on IntegriCloud