Unverified Commit a413c563 authored by Qizhi Hu's avatar Qizhi Hu Committed by GitHub
Browse files

[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: default avatarhuqizhi <836744285@qq.com>
parent eaee8aa0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment