diff options
Diffstat (limited to 'clang/lib/Sema/SemaConcept.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaConcept.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp index ddd95faebe99..1ff7b1cdd515 100644 --- a/clang/lib/Sema/SemaConcept.cpp +++ b/clang/lib/Sema/SemaConcept.cpp @@ -1053,25 +1053,20 @@ ReturnTypeRequirement(TemplateParameterList *TPL) : auto *Constraint = cast_or_null<ConceptSpecializationExpr>( TC->getImmediatelyDeclaredConstraint()); - bool Dependent = false; - if (Constraint->getTemplateArgsAsWritten()) { - for (auto &ArgLoc : - Constraint->getTemplateArgsAsWritten()->arguments().drop_front(1)) { - if (ArgLoc.getArgument().isDependent()) { - Dependent = true; - break; - } - } - } + bool Dependent = + Constraint->getTemplateArgsAsWritten() && + TemplateSpecializationType::anyInstantiationDependentTemplateArguments( + Constraint->getTemplateArgsAsWritten()->arguments().drop_front(1)); TypeConstraintInfo.setInt(Dependent ? 1 : 0); } concepts::TypeRequirement::TypeRequirement(TypeSourceInfo *T) : - Requirement(RK_Type, T->getType()->isDependentType(), + Requirement(RK_Type, T->getType()->isInstantiationDependentType(), T->getType()->containsUnexpandedParameterPack(), // We reach this ctor with either dependent types (in which // IsSatisfied doesn't matter) or with non-dependent type in // which the existence of the type indicates satisfaction. - /*IsSatisfied=*/true - ), Value(T), - Status(T->getType()->isDependentType() ? SS_Dependent : SS_Satisfied) {} + /*IsSatisfied=*/true), + Value(T), + Status(T->getType()->isInstantiationDependentType() ? SS_Dependent + : SS_Satisfied) {} |
