Skip to content
Unverified Commit 7b338998 authored by Qizhi Hu's avatar Qizhi Hu Committed by GitHub
Browse files

[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: default avatarhuqizhi <836744285@qq.com>
parent 02d56801
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment