Fix template argument deduction when a parameter pack has a value
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 19 Jul 2018 19:00:37 +0000 (19:00 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 19 Jul 2018 19:00:37 +0000 (19:00 +0000)
commit4a8f3518cb1444f7041ecb36fceb49d59f08b4b1
tree993ad7351ac668d1ff6fdefcfd17c49bdfc5d408
parentf29044536d7a77cac152948a066c44e7cb010627
Fix template argument deduction when a parameter pack has a value
provided by an outer template.

We made the incorrect assumption in various places that the only way we
can have any arguments already provided for a pack during template
argument deduction was from a partially-specified pack. That's not true;
we can also have arguments from an enclosing already-instantiated
template, and that can even result in the function template's own pack
parameters having a fixed length and not being packs for the purposes of
template argument deduction.

llvm-svn: 337481
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/include/clang/Sema/TemplateDeduction.h
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaTemplateVariadic.cpp
clang/test/SemaTemplate/pack-deduction.cpp