File tree Expand file tree Collapse file tree 3 files changed +45
-1
lines changed
source/Plugins/ExpressionParser/Clang Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -1060,6 +1060,16 @@ ClangASTImporter::MapCompleter::~MapCompleter() = default;
10601060
10611061llvm::Expected<Decl *>
10621062ClangASTImporter::ASTImporterDelegate::ImportImpl (Decl *From) {
1063+ // FIXME: The Minimal import mode of clang::ASTImporter does not correctly
1064+ // import Lambda definitions. Work around this for now by not importing
1065+ // lambdas at all. This is most likely encountered when importing decls from
1066+ // the `std` module (not from debug-info), where lambdas can be defined in
1067+ // inline function bodies. Those will be imported by LLDB.
1068+ if (const auto *CXX = llvm::dyn_cast<clang::CXXRecordDecl>(From))
1069+ if (CXX->isLambda ())
1070+ return llvm::make_error<ASTImportError>(
1071+ ASTImportError::UnsupportedConstruct);
1072+
10631073 if (m_std_handler) {
10641074 std::optional<Decl *> D = m_std_handler->Import (From);
10651075 if (D) {
Original file line number Diff line number Diff line change 11from lldbsuite .test import lldbinline
22from lldbsuite .test import decorators
33
4- lldbinline .MakeInlineTest (__file__ , globals ())
4+ lldbinline .MakeInlineTest (
5+ __file__ ,
6+ globals (),
7+ [
8+ decorators .expectedFailureAll (
9+ bugnumber = "https://github.com/llvm/llvm-project/issues/149477"
10+ )
11+ ],
12+ )
Original file line number Diff line number Diff line change 1+ # Test that we can successfully ASTImport clang::LambdaExpr nodes.
2+ # Currently this is not supported in MinimalImport mode (which LLDB
3+ # uses always).
4+
5+ # RUN: split-file %s %t
6+ # RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out
7+ # RUN: %lldb -o "settings set interpreter.stop-command-source-on-error false" \
8+ # RUN: -x -b -s %t/commands.input %t.out 2>&1 \
9+ # RUN: | FileCheck %s
10+
11+ #--- main.cpp
12+
13+ int main() {
14+ __builtin_debugtrap();
15+ }
16+
17+ #--- commands.input
18+
19+ run
20+ expression --top-level -- void method(int x) { [x=x] { ; }; }
21+ target dump typesystem
22+
23+ # CHECK: expression
24+ # CHECK: target dump typesystem
25+ # CHECK-NOT: FunctionDecl
26+ # CHECK-NOT: LambdaExpr
You can’t perform that action at this time.
0 commit comments