[Concepts] Instantiate invented template type parameter type-constraint along with...
authorSaar Raz <saar@raz.email>
Mon, 3 Feb 2020 13:44:33 +0000 (15:44 +0200)
committerSaar Raz <saar@raz.email>
Mon, 3 Feb 2020 14:51:49 +0000 (16:51 +0200)
commit84959ae47f447fca9d56a9c61e8c46e993d0387a
tree7ce91f0ce5cab73ab2dbe70799f6eec4ab9742ae
parent1ca740387b9bbdc142ac81c8bdd6370a8813e328
[Concepts] Instantiate invented template type parameter type-constraint along with function parameters

We previously instantiated type-constraints of template type parameters along with the type parameter itself,
this caused problems when the type-constraints created by abbreviated templates refreneced other parameters
in the abbreviated templates.

When encountering a template type parameter with a type constraint, if it is implicit, delay instantiation of
the type-constraint until the function parameter which created the invented template type parameter is
instantiated.

Reland after fixing bug caused by another flow reaching SubstParmVarDecl and instantiating the TypeConstraint
a second time.
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/SemaTemplate/instantiate-abbreviated-template.cpp [new file with mode: 0644]