]> granicus.if.org Git - clang/commit
PR38136: improve handling of template argument deduction of non-trailing
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 12 Jul 2018 23:32:39 +0000 (23:32 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 12 Jul 2018 23:32:39 +0000 (23:32 +0000)
commitfb6fe237ce9a38b43c0eb39bbd6afa63c01ac70f
tree19351dc5ce16bebf45a4f3c643050f6e924c6492
parent0e073980598008bb839173d40f1b1306b16bc902
PR38136: improve handling of template argument deduction of non-trailing
function parameter packs.

This makes our handling of non-trailing function parameter packs
consistent between the case of deduction at the top level in a function
call and other cases where deduction encounters a non-trailing function
parameter pack.

Instead of treating a non-trailing pack and all later parameters as
being non-deduced, we treat a non-trailing pack as exactly matching
any explicitly-specified template arguments (or being an empty pack
if there are no such arguments). This corresponds to the "never deduced"
rule in [temp.deduct.call]p1, but generalized to all deduction contexts.

Non-trailing template argument packs still result in the entire
template argument list being treated as non-deduced, as specified in
[temp.deduct.type]p9.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336962 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplateDeduction.cpp
test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp
test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp