Commit Graph

5 Commits

Author SHA1 Message Date
Saar Raz 865456d589 [Concepts] Add null check for TemplateTypeParmType::getDecl() in GetContainedInventedTypeParmVisitor
GetContainedInventedTypeParmVisitor would not account for the case where TemplateTypeParmType::getDecl() is
nullptr, causing bug #45102.

Add the nullptr check.
2020-03-06 19:32:10 +02:00
Saar Raz 38fd69995f [Concepts] Fix incorrect check when instantiating abbreviated template type-constraints
We would incorrectly check whether the type-constraint had already been initialized, causing us
to ignore the invented template type constraints entirely.

Also, TemplateParameterList would store incorrect information about invented type parameters
when it observed them before their type-constraint was initialized, so we recreate it after
initializing the function type of an abbreviated template.
2020-02-06 23:29:07 +02:00
Saar Raz 84959ae47f [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.
2020-02-03 16:51:49 +02:00
Saar Raz 8c16d8b235 Revert "[Concepts] Instantiate invented template type parameter type-constraint along with function parameters"
This temporarily reverts commit eacca48244, which caused some test failures.
2020-02-03 16:04:48 +02:00
Saar Raz eacca48244 [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.
2020-02-03 15:47:32 +02:00