diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index 6fe85a1298fcb..783a5f1788039 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -482,6 +482,15 @@ void ClangASTSource::FindExternalLexicalDecls( if (!copied_decl) continue; + // FIXME: We should add the copied decl to the 'decls' list. This would + // add the copied Decl into the DeclContext and make sure that we + // correctly propagate that we added some Decls back to Clang. + // By leaving 'decls' empty we incorrectly return false from + // DeclContext::LoadLexicalDeclsFromExternalStorage which might cause + // lookup issues later on. + // We can't just add them for now as the ASTImporter already added the + // decl into the DeclContext and this would add it twice. + if (FieldDecl *copied_field = dyn_cast(copied_decl)) { QualType copied_field_type = copied_field->getType();