diff options
author | cor3ntin <corentinjabot@gmail.com> | 2025-05-22 21:57:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-22 21:57:45 +0200 |
commit | 73fda8327539106d2644fd3c566e528564f74562 (patch) | |
tree | 8ff91874357b8d5089cfefdf0e073ef3031f9583 /clang/lib/Sema/SemaConcept.cpp | |
parent | 13e1a2cb2246dc5e9a4afcdacabed4d43154ec3f (diff) | |
download | llvm-73fda8327539106d2644fd3c566e528564f74562.zip llvm-73fda8327539106d2644fd3c566e528564f74562.tar.gz llvm-73fda8327539106d2644fd3c566e528564f74562.tar.bz2 |
[Clang] Do not put the definition of concept nodes in the Sema library (#141104)
It is a layering violation
Diffstat (limited to 'clang/lib/Sema/SemaConcept.cpp')
-rw-r--r-- | clang/lib/Sema/SemaConcept.cpp | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp index aef7864..7da8e69 100644 --- a/clang/lib/Sema/SemaConcept.cpp +++ b/clang/lib/Sema/SemaConcept.cpp @@ -1782,64 +1782,6 @@ bool Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic( return true; } -concepts::ExprRequirement::ExprRequirement( - Expr *E, bool IsSimple, SourceLocation NoexceptLoc, - ReturnTypeRequirement Req, SatisfactionStatus Status, - ConceptSpecializationExpr *SubstitutedConstraintExpr) : - Requirement(IsSimple ? RK_Simple : RK_Compound, Status == SS_Dependent, - Status == SS_Dependent && - (E->containsUnexpandedParameterPack() || - Req.containsUnexpandedParameterPack()), - Status == SS_Satisfied), Value(E), NoexceptLoc(NoexceptLoc), - TypeReq(Req), SubstitutedConstraintExpr(SubstitutedConstraintExpr), - Status(Status) { - assert((!IsSimple || (Req.isEmpty() && NoexceptLoc.isInvalid())) && - "Simple requirement must not have a return type requirement or a " - "noexcept specification"); - assert((Status > SS_TypeRequirementSubstitutionFailure && Req.isTypeConstraint()) == - (SubstitutedConstraintExpr != nullptr)); -} - -concepts::ExprRequirement::ExprRequirement( - SubstitutionDiagnostic *ExprSubstDiag, bool IsSimple, - SourceLocation NoexceptLoc, ReturnTypeRequirement Req) : - Requirement(IsSimple ? RK_Simple : RK_Compound, Req.isDependent(), - Req.containsUnexpandedParameterPack(), /*IsSatisfied=*/false), - Value(ExprSubstDiag), NoexceptLoc(NoexceptLoc), TypeReq(Req), - Status(SS_ExprSubstitutionFailure) { - assert((!IsSimple || (Req.isEmpty() && NoexceptLoc.isInvalid())) && - "Simple requirement must not have a return type requirement or a " - "noexcept specification"); -} - -concepts::ExprRequirement::ReturnTypeRequirement:: -ReturnTypeRequirement(TemplateParameterList *TPL) : - TypeConstraintInfo(TPL, false) { - assert(TPL->size() == 1); - const TypeConstraint *TC = - cast<TemplateTypeParmDecl>(TPL->getParam(0))->getTypeConstraint(); - assert(TC && - "TPL must have a template type parameter with a type constraint"); - auto *Constraint = - cast<ConceptSpecializationExpr>(TC->getImmediatelyDeclaredConstraint()); - bool Dependent = - Constraint->getTemplateArgsAsWritten() && - TemplateSpecializationType::anyInstantiationDependentTemplateArguments( - Constraint->getTemplateArgsAsWritten()->arguments().drop_front(1)); - TypeConstraintInfo.setInt(Dependent ? true : false); -} - -concepts::TypeRequirement::TypeRequirement(TypeSourceInfo *T) : - 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()->isInstantiationDependentType() ? SS_Dependent - : SS_Satisfied) {} - NormalizedConstraint::CompoundConstraintKind NormalizedConstraint::getCompoundKind() const { assert(isCompound() && "getCompoundKind on a non-compound constraint.."); |