[Clang][Sema] Fix a bug on template partial specialization with issue on...
[Clang][Sema] Fix a bug on template partial specialization with issue on deduction of nontype template parameter (#90376) Fix https://github.com/llvm/llvm-project/issues/68885 When build expression from a deduced argument whose kind is `Declaration` and `NTTPType`(which declared as `decltype(auto)`) is deduced as a reference type, `BuildExpressionFromDeclTemplateArgument` just create a `DeclRef`. This is incorrect while we get type from the expression since we can't get the original reference type from `DeclRef`. Creating a `SubstNonTypeTemplateParmExpr` expression and make the deduction correct. `Replacement` expression of `SubstNonTypeTemplateParmExpr` just helps the deduction and may not be same with the original expression. Co-authored-by:huqizhi <836744285@qq.com>
parent
eaee8aa0
Please register or sign in to comment