[clang] [clang] Fix CTAD not respect default template arguments that were added after the definition. (PR #75569)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 18:38:56 PST 2023


================
@@ -2061,13 +2070,13 @@ DeclResult Sema::CheckClassTemplate(
   if (!(TUK == TUK_Friend && CurContext->isDependentContext()) &&
       CheckTemplateParameterList(
           TemplateParams,
-          PrevClassTemplate
-              ? PrevClassTemplate->getMostRecentDecl()->getTemplateParameters()
-              : nullptr,
+          PrevClassTemplate ? GetTemplateParameterList(PrevClassTemplate)
+                            : nullptr,
           (SS.isSet() && SemanticContext && SemanticContext->isRecord() &&
            SemanticContext->isDependentContext())
               ? TPC_ClassTemplateMember
-              : TUK == TUK_Friend ? TPC_FriendClassTemplate : TPC_ClassTemplate,
+          : TUK == TUK_Friend ? TPC_FriendClassTemplate
----------------
shafik wrote:

This looks like an unrelated change and it looks funny.

https://github.com/llvm/llvm-project/pull/75569


More information about the cfe-commits mailing list