summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2025-12-27 23:21:13 +0100
committerDimitry Andric <dim@FreeBSD.org>2025-12-27 23:21:13 +0100
commit294ba569803972323a64670451a82af53c660541 (patch)
tree1432420370a4676c985c5b9c06145f8a00223f88 /lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
parent7f920884cd004f9e2e60b3efda5bd75f287faa9d (diff)
Vendor import of llvm-project branch release/21.x llvmorg-21.1.7-0-gcd708029e0b2, a.k.a. 21.1.7 release.vendor/llvm-project/llvmorg-21.1.7-0-gcd708029e0b2
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
index 2529e78f78bc..633b860b5784 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
@@ -1053,6 +1053,16 @@ ClangASTImporter::MapCompleter::~MapCompleter() = default;
llvm::Expected<Decl *>
ClangASTImporter::ASTImporterDelegate::ImportImpl(Decl *From) {
+ // FIXME: The Minimal import mode of clang::ASTImporter does not correctly
+ // import Lambda definitions. Work around this for now by not importing
+ // lambdas at all. This is most likely encountered when importing decls from
+ // the `std` module (not from debug-info), where lambdas can be defined in
+ // inline function bodies. Those will be imported by LLDB.
+ if (const auto *CXX = llvm::dyn_cast<clang::CXXRecordDecl>(From))
+ if (CXX->isLambda())
+ return llvm::make_error<ASTImportError>(
+ ASTImportError::UnsupportedConstruct);
+
if (m_std_handler) {
std::optional<Decl *> D = m_std_handler->Import(From);
if (D) {