Index: include/clang/AST/ExternalASTMerger.h =================================================================== --- include/clang/AST/ExternalASTMerger.h +++ include/clang/AST/ExternalASTMerger.h @@ -44,10 +44,6 @@ FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref IsKindWeWant, SmallVectorImpl &Result) override; - - using ExternalASTSource::CompleteType; - - void CompleteType(TagDecl *Tag) override; }; } // end namespace clang Index: lib/AST/ExternalASTMerger.cpp =================================================================== --- lib/AST/ExternalASTMerger.cpp +++ lib/AST/ExternalASTMerger.cpp @@ -180,8 +180,3 @@ }); } -void ExternalASTMerger::CompleteType(TagDecl *Tag) { - SmallVector Result; - FindExternalLexicalDecls(Tag, [](Decl::Kind) { return true; }, Result); - Tag->setHasExternalLexicalStorage(false); -} Index: test/Import/direct/test.c =================================================================== --- test/Import/direct/test.c +++ test/Import/direct/test.c @@ -1,4 +1,4 @@ -// RUN: clang-import-test -import %S/Inputs/S.c -expression %s +// RUN: clang-import-test -direct -import %S/Inputs/S.c -expression %s void expr() { struct S MyS; MyS.a = 3; Index: tools/clang-import-test/clang-import-test.cpp =================================================================== --- tools/clang-import-test/clang-import-test.cpp +++ tools/clang-import-test/clang-import-test.cpp @@ -182,14 +182,6 @@ return Ins; } -std::unique_ptr -BuildCompilerInstance(ArrayRef ClangArgs) { - std::vector ClangArgv(ClangArgs.size()); - std::transform(ClangArgs.begin(), ClangArgs.end(), ClangArgv.begin(), - [](const std::string &s) -> const char * { return s.data(); }); - return init_convenience::BuildCompilerInstance(ClangArgv); -} - std::unique_ptr BuildASTContext(CompilerInstance &CI, SelectorTable &ST, Builtin::Context &BC) { auto AST = llvm::make_unique( @@ -315,12 +307,8 @@ for (auto &ImportCI : ImportCIs) { llvm::Expected> IndirectCI = BuildIndirect(ImportCI); - if (auto E = IndirectCI.takeError()) { - llvm::errs() << llvm::toString(std::move(E)); - exit(-1); - } else { - IndirectCIs.push_back(std::move(*IndirectCI)); - } + assert(!IndirectCI.takeError()); + IndirectCIs.push_back(std::move(*IndirectCI)); } } llvm::Expected> ExpressionCI =