Index: packages/Python/lldbsuite/test/expression_command/completion-crash-lambda/TestCompletionCrashInLambda.py =================================================================== --- packages/Python/lldbsuite/test/expression_command/completion-crash-lambda/TestCompletionCrashInLambda.py +++ packages/Python/lldbsuite/test/expression_command/completion-crash-lambda/TestCompletionCrashInLambda.py @@ -1,4 +1,4 @@ from lldbsuite.test import lldbinline from lldbsuite.test import decorators -lldbinline.MakeInlineTest(__file__, globals(), [decorators.skipIf(bugnumber="rdar://53755023")]) +lldbinline.MakeInlineTest(__file__, globals(), []) Index: source/Symbol/ClangASTContext.cpp =================================================================== --- source/Symbol/ClangASTContext.cpp +++ source/Symbol/ClangASTContext.cpp @@ -1508,8 +1508,25 @@ *ast, (TagDecl::TagKind)kind, decl_ctx, SourceLocation(), SourceLocation(), is_anonymous ? nullptr : &ast->Idents.get(name)); - if (is_anonymous) - decl->setAnonymousStructOrUnion(true); + if (is_anonymous) { + // The current heuristic for checking if a CXXRecordDecl is anonymous is if + // there is no name or if it is just a null terminator. + // This is not accurate since currently this can sweep up both unnamed + // classes and lambdas as anonymous classes, which they are not. + // + // Anonymous classes is a GNU/MSVC extension that clang supports. It + // requires the anonymous class be embedded within a class. So the new + // heuristic verifies this condition. + // + // This fix will unfortunately still mislabel unnamed classes within a class + // but this improves the situation greatly since getting this wrong in the + // other cases can lead to an assert in clang CodeCompletion since + // SemaAccess assumes the DeclContext of an anonymous class is a + // CXXRecordDecl. + if (CXXRecordDecl *record = dyn_cast(decl_ctx)) { + decl->setAnonymousStructOrUnion(true); + } + } if (decl) { if (metadata)