Skip to content

Commit 0e67299

Browse files
committed
[lldb][Type Completionb] Don't register decls as imported if candidate definition is not found
1 parent fdf30fb commit 0e67299

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,15 +1210,14 @@ ClangASTImporter::ASTImporterDelegate::ImportImpl(Decl *From) {
12101210
DeclContext::lookup_result lr = dc->lookup(*dn_or_err);
12111211
for (clang::Decl *candidate : lr) {
12121212
if (candidate->getKind() == From->getKind()) {
1213-
RegisterImportedDecl(From, candidate);
1214-
1215-
// If we're dealing with redecl chains. We want to find the definition,
1213+
// If we're dealing with redecl chains, we want to find the definition,
12161214
// so skip if the decl is actually just a forwad decl.
12171215
if (TypeSystemClang::UseRedeclCompletion())
12181216
if (auto *tag_decl = llvm::dyn_cast<TagDecl>(candidate);
12191217
!tag_decl || !tag_decl->getDefinition())
12201218
continue;
12211219

1220+
RegisterImportedDecl(From, candidate);
12221221
m_decls_to_ignore.insert(candidate);
12231222
return candidate;
12241223
}

0 commit comments

Comments
 (0)