From ba59d7d4782353bcb163b6476cd0b0dee74929c7 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Fri, 26 Sep 2025 22:57:29 +0100 Subject: [PATCH] [lldb][TypeSystemClang] Don't call getInjectedClassNameType when creating class template decls This was a remnant of the type completion rework. But that was reverted, and this isn't necessary anymore (and removing it fixes the unit-test failure). rdar://159893045 --- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 3 --- lldb/unittests/Symbol/TestTypeSystemClang.cpp | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index 4c51ef190f2b4..a44be15aca3e6 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -1640,9 +1640,6 @@ ClassTemplateDecl *TypeSystemClang::CreateClassTemplateDecl( class_template_decl->init(template_cxx_decl); template_cxx_decl->setDescribedClassTemplate(class_template_decl); SetOwningModule(class_template_decl, owning_module); - ast.getInjectedClassNameType( - template_cxx_decl, - class_template_decl->getInjectedClassNameSpecialization()); if (access_type != eAccessNone) class_template_decl->setAccess( diff --git a/lldb/unittests/Symbol/TestTypeSystemClang.cpp b/lldb/unittests/Symbol/TestTypeSystemClang.cpp index b5ca302d78861..b0dcc01189c71 100644 --- a/lldb/unittests/Symbol/TestTypeSystemClang.cpp +++ b/lldb/unittests/Symbol/TestTypeSystemClang.cpp @@ -685,9 +685,7 @@ TEST_F(TestCreateClassTemplateDecl, FindExistingTemplates) { // The behaviour should follow the C++ rules for redeclaring templates // (e.g., parameter names can be changed/omitted.) - // Test an empty template parameter list: <> - // This first expect causes an assert. rdar://159893045 - // ExpectNewTemplate("<>", {{}, {}}); + ExpectNewTemplate("<>", {{}, {}}); clang::TemplateArgument intArg(m_ast->getASTContext().IntTy); clang::TemplateArgument int47Arg(m_ast->getASTContext(),