[Clang][Sema] fix outline member function template with default align crash (#78400)
Try to fix [issue](https://github.com/llvm/llvm-project/issues/68490 ) and some extented problem. Root cause of current issue is that error handling in instantiation of function parameter with default initialization on sizeof or align expression. When instance an out-of-line template member function, depth of `TemplateTypeParmDecl` in default initialization doesn't change while depth of other template parameter does and this will lead to some template parameter uninstanced. Also, sometime it will leader to wrong instantiation when it uses the template parameter of class. Fix it by add template args of context when it's out-of-line. This will make `MultiLevelTemplateArgumentList::getNumLevels` matching the depth of template parameter. Testcase with some `static_assert` demonstrates the template parameter has been instanced correctly. Co-authored-by:huqizhi <836744285@qq.com>
Loading
Please sign in to comment