[Concepts] Correctly form initial parameter mapping for parameter packs, support...
authorSaar Raz <saar@raz.email>
Fri, 31 Jan 2020 13:55:06 +0000 (15:55 +0200)
committerSaar Raz <saar@raz.email>
Fri, 31 Jan 2020 13:59:42 +0000 (15:59 +0200)
commitba1f3db4b0729ad932aa4f091e9578132d98a0c8
treea3bcd56f35965b9c4b4f71c73da8e0b0c9c4a2a8
parent3a200f3f2e52e671b8d9911e3724d6b11dbbbe08
[Concepts] Correctly form initial parameter mapping for parameter packs, support substitution into SubstNonTypeTemplateParmExpr

We previously would not correctly for the initial parameter mapping for variadic template parameters in Concepts.
Testing this lead to the discovery that with the normalization process we would need to substitute into already-substituted-into
template arguments, which means we need to add NonTypeTemplateParmExpr support to TemplateInstantiator.
We do that by substituting into the replacement and the type separately, and then re-checking the expression against the NTTP
with the new type, in order to form any new required implicit casts (for cases where the type of the NTTP was dependent).
clang/include/clang/Sema/Sema.h
clang/include/clang/Sema/SemaConcept.h
clang/lib/Sema/SemaConcept.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/test/CXX/temp/temp.constr/temp.constr.normal/p1.cpp
clang/test/SemaTemplate/instantiate-template-argument.cpp [new file with mode: 0644]