[clang] [Clang][Sema] fix outline member function template with default align crash (PR #78400)

Qizhi Hu via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 21:20:23 PST 2024


================
@@ -3063,11 +3064,18 @@ bool Sema::SubstDefaultArgument(
           /*ForDefinition*/ false);
       if (addInstantiatedParametersToScope(FD, PatternFD, *LIS, TemplateArgs))
         return true;
+      if (FD->isOutOfLine()) {
+        auto *CurrentTemplateArgumentList = TemplateArgumentList::CreateCopy(
+            getASTContext(), TemplateArgs.getInnermost());
+        NewTemplateArgs = getTemplateInstantiationArgs(
+            FD, FD->getDeclContext(), true, CurrentTemplateArgumentList, true,
+            nullptr, false, false);
----------------
jcsxky wrote:

All review has been applied.

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


More information about the cfe-commits mailing list