;
39 const Expr*LHS =
nullptr;
40 const Expr*RHS =
nullptr;
43LogicalBinOp(
const Expr*
E) {
44 if(
auto*BO = dyn_cast<BinaryOperator>(
E)) {
48 Loc= BO->getExprLoc();
49}
else if(
auto*OO = dyn_cast<CXXOperatorCallExpr>(
E)) {
51 if(OO->getNumArgs() == 2) {
52Op = OO->getOperator();
55 Loc= OO->getOperatorLoc();
60 boolisAnd()
const{
returnOp == OO_AmpAmp; }
61 boolisOr()
const{
returnOp == OO_PipePipe; }
62 explicit operator bool()
const{
returnisAnd() || isOr(); }
64 const Expr*getLHS()
const{
returnLHS; }
65 const Expr*getRHS()
const{
returnRHS; }
69 returnrecreateBinOp(SemaRef, LHS,
const_cast<Expr*
>(getRHS()));
74assert((isAnd() || isOr()) &&
"Not the right kind of op?");
91 TokenNextToken,
bool*PossibleNonPrimary,
92 boolIsTrailingRequiresClause) {
98 if(LogicalBinOp BO = ConstraintExpression) {
100PossibleNonPrimary) &&
103}
else if(
auto*
C= dyn_cast<ExprWithCleanups>(ConstraintExpression))
109 autoCheckForNonPrimary = [&] {
110 if(!PossibleNonPrimary)
113*PossibleNonPrimary =
124(NextToken.
is(tok::l_paren) &&
125(IsTrailingRequiresClause ||
127isa<UnresolvedLookupExpr>(ConstraintExpression) &&
143CheckForNonPrimary();
149diag::err_non_bool_atomic_constraint) <<
Type 151CheckForNonPrimary();
155 if(PossibleNonPrimary)
156*PossibleNonPrimary =
false;
161structSatisfactionStackRAII {
163 boolInserted =
false;
165 constllvm::FoldingSetNodeID &FSNID)
172~SatisfactionStackRAII() {
179template<
typenameConstra
intEvaluator>
183 constConstraintEvaluator &Evaluator);
185template<
typenameConstra
intEvaluator>
190 constConstraintEvaluator &Evaluator) {
191 size_tEffectiveDetailEndIndex = Satisfaction.
Details.size();
201 if(Op == clang::OO_PipePipe && IsLHSSatisfied)
211 if(Op == clang::OO_AmpAmp && !IsLHSSatisfied)
235 if(Op == clang::OO_PipePipe && IsRHSSatisfied) {
236 autoEffectiveDetailEnd = Satisfaction.
Details.begin();
237std::advance(EffectiveDetailEnd, EffectiveDetailEndIndex);
238Satisfaction.
Details.erase(EffectiveDetailEnd, Satisfaction.
Details.end());
250template<
typenameConstra
intEvaluator>
254 constConstraintEvaluator &Evaluator) {
255 boolConjunction = FE->
getOperator() == BinaryOperatorKind::BO_LAnd;
256 size_tEffectiveDetailEndIndex = Satisfaction.
Details.size();
272std::optional<unsigned> NumExpansions =
273Evaluator.EvaluateFoldExpandedConstraintSize(FE);
276 for(
unsignedI = 0; I < *NumExpansions; I++) {
279Satisfaction, Evaluator);
283 if(!Conjunction && IsRHSSatisfied) {
284 autoEffectiveDetailEnd = Satisfaction.
Details.begin();
285std::advance(EffectiveDetailEnd, EffectiveDetailEndIndex);
286Satisfaction.
Details.erase(EffectiveDetailEnd,
296 if(Conjunction != IsRHSSatisfied)
302Satisfaction, Evaluator);
322template<
typenameConstra
intEvaluator>
326 constConstraintEvaluator &Evaluator) {
329 if(LogicalBinOp BO = ConstraintExpr)
331S, BO.getLHS(), BO.getOp(), BO.getRHS(), Satisfaction, Evaluator);
333 if(
auto*
C= dyn_cast<ExprWithCleanups>(ConstraintExpr)) {
340 if(
auto*FE = dyn_cast<CXXFoldExpr>(ConstraintExpr);
342(FE->getOperator() == BinaryOperatorKind::BO_LAnd ||
343FE->getOperator() == BinaryOperatorKind::BO_LOr)) {
349Evaluator.EvaluateAtomicConstraint(ConstraintExpr);
354 if(!SubstitutedAtomicExpr.
isUsable())
371 unsignedMessageSize = DiagString.size();
372 char*Mem =
new(S.
Context)
char[MessageSize];
373 memcpy(Mem, DiagString.c_str(), MessageSize);
374Satisfaction.
Details.emplace_back(
376SubstitutedAtomicExpr.get()->getBeginLoc(),
377StringRef(Mem, MessageSize)});
378 returnSubstitutedAtomicExpr;
385EvalResult.
Diag= &EvaluationDiags;
388!EvaluationDiags.empty()) {
392diag::err_non_constant_constraint_expression)
395S.
Diag(PDiag.first, PDiag.second);
399assert(EvalResult.
Val.
isInt() &&
400 "evaluating bool expression didn't produce int");
403Satisfaction.
Details.emplace_back(SubstitutedAtomicExpr.
get());
405 returnSubstitutedAtomicExpr;
413 for(
const auto&List : MLTAL)
437 structConstraintEvaluator {
446S, Sema::ExpressionEvaluationContext::ConstantEvaluated,
456 const_cast<NamedDecl*
>(Template), Info,
461llvm::FoldingSetNodeID
ID;
469SatisfactionStackRAII StackRAII(S, Template,
ID);
473SubstitutedExpression =
497 unsignedMessageSize = DiagString.size();
498 char*Mem =
new(S.
Context)
char[MessageSize];
499 memcpy(Mem, DiagString.c_str(), MessageSize);
500Satisfaction.
Details.emplace_back(
502SubstDiag.first, StringRef(Mem, MessageSize)});
524CK_LValueToRValue, SubstitutedExpression.
get(),
527 returnSubstitutedExpression;
530std::optional<unsigned>
531EvaluateFoldExpandedConstraintSize(
const CXXFoldExpr*FE)
const{
540assert(!Unexpanded.empty() &&
"Pack expansion without parameter packs?");
542 boolRetainExpansion =
false;
544NumExpansions = OrigNumExpansions;
547MLTAL, Expand, RetainExpansion, NumExpansions) ||
548!Expand || RetainExpansion)
551 if(NumExpansions && S.
getLangOpts().BracketDepth < NumExpansions) {
553clang::diag::err_fold_expression_limit_exceeded)
554<< *NumExpansions << S.
getLangOpts().BracketDepth
559 returnNumExpansions;
564S, ConstraintExpr, Satisfaction,
565ConstraintEvaluator{S, Template, TemplateNameLoc, MLTAL, Satisfaction});
573 if(ConstraintExprs.empty()) {
590 const_cast<NamedDecl*
>(Template), TemplateArgs, TemplateIDRange);
594 for(
const Expr*ConstraintExpr : ConstraintExprs) {
596S, Template, TemplateIDRange.
getBegin(), TemplateArgsLists,
597ConstraintExpr, Satisfaction);
601Converted.push_back(Res.
get());
605Converted.append(ConstraintExprs.size() - Converted.size(),
nullptr);
621 if(ConstraintExprs.empty()) {
626return ::CheckConstraintSatisfaction(
627*
this,
nullptr, ConstraintExprs, ConvertedConstraints,
628TemplateArgsLists, TemplateIDRange, OutSatisfaction);
642 for(
autoList : TemplateArgsLists)
643FlattenedArgs.insert(FlattenedArgs.end(), List.Args.begin(),
646llvm::FoldingSetNodeID ID;
649 if(
auto*Cached = SatisfactionCache.FindNodeOrInsertPos(ID, InsertPos)) {
650OutSatisfaction = *Cached;
655std::make_unique<ConstraintSatisfaction>(Template, FlattenedArgs);
657ConvertedConstraints, TemplateArgsLists,
658TemplateIDRange, *Satisfaction)) {
659OutSatisfaction = *Satisfaction;
663 if(
auto*Cached = SatisfactionCache.FindNodeOrInsertPos(ID, InsertPos)) {
672OutSatisfaction = *Cached;
677OutSatisfaction = *Satisfaction;
681SatisfactionCache.InsertNode(Satisfaction.release());
688 structConstraintEvaluator {
694std::optional<unsigned>
695EvaluateFoldExpandedConstraintSize(
const CXXFoldExpr*FE)
const{
701ConstraintEvaluator{*
this})
705boolSema::addInstantiatedCapturesToScope(
709 const auto*LambdaClass = cast<CXXMethodDecl>(
Function)->getParent();
710 const auto*LambdaPattern = cast<CXXMethodDecl>(PatternDecl)->getParent();
712 unsignedInstantiated = 0;
714 autoAddSingleCapture = [&](
const ValueDecl*CapturedPattern,
716 ValueDecl*CapturedVar = LambdaClass->getCapture(Index)->getCapturedVar();
718 Scope.InstantiatedLocal(CapturedPattern, CapturedVar);
721 for(
const LambdaCapture&CapturePattern : LambdaPattern->captures()) {
722 if(!CapturePattern.capturesVariable()) {
726 ValueDecl*CapturedPattern = CapturePattern.getCapturedVar();
734AddSingleCapture(CapturedPattern, Instantiated++);
736 Scope.MakeInstantiatedLocalArgPack(CapturedPattern);
739dyn_cast<VarDecl>(CapturedPattern)->getInit(), Unexpanded);
740 autoNumArgumentsInExpansion =
742 if(!NumArgumentsInExpansion)
744 for(
unsignedArg = 0; Arg < *NumArgumentsInExpansion; ++Arg)
745AddSingleCapture(CapturedPattern, Instantiated++);
751boolSema::SetupConstraintScope(
756 "Use LambdaScopeForCallOperatorInstantiationRAII to handle lambda " 760InstantiatingTemplate Inst(
765 if(Inst.isInvalid())
776 if(addInstantiatedParametersToScope(
785 if(addInstantiatedParametersToScope(FD, FromMemTempl->getTemplatedDecl(),
800InstantiatingTemplate Inst(
805 if(Inst.isInvalid())
810 if(addInstantiatedParametersToScope(FD, InstantiatedFrom,
Scope, MLTAL))
819std::optional<MultiLevelTemplateArgumentList>
820Sema::SetupConstraintCheckingTemplateArgumentsAndScope(
830 false,
std::nullopt,
837 if(SetupConstraintScope(FD, TemplateArgs, MLTAL,
Scope))
846 boolForOverloadResolution) {
865 if(
const auto*MD = dyn_cast<CXXConversionDecl>(FD);
868Satisfaction, UsageLoc,
882std::optional<MultiLevelTemplateArgumentList> MLTAL =
883SetupConstraintCheckingTemplateArgumentsAndScope(
891 if(
auto*Method = dyn_cast<CXXMethodDecl>(FD)) {
892ThisQuals = Method->getMethodQualifiers();
899ForOverloadResolution);
913 boolSkipForSpecialization =
false) {
919 true, SkipForSpecialization);
924 classAdjustConstraintDepth :
public TreeTransform<AdjustConstraintDepth> {
925 unsignedTemplateDepth = 0;
928AdjustConstraintDepth(
Sema&SemaRef,
unsignedTemplateDepth)
929: inherited(SemaRef), TemplateDepth(TemplateDepth) {}
931 usinginherited::TransformTemplateTypeParmType;
938NewTTPDecl = cast_or_null<TemplateTypeParmDecl>(
939TransformDecl(TL.
getNameLoc(), OldTTPDecl));
941 QualTypeResult = getSema().Context.getTemplateTypeParmType(
942 T->getDepth() + TemplateDepth,
T->getIndex(),
T->isParameterPack(),
953 const Expr*ConstrExpr) {
977std::optional<LocalInstantiationScope> ScopeForParameters;
980ScopeForParameters.emplace(S,
true);
983 if(!PVD->isParameterPack()) {
984ScopeForParameters->InstantiatedLocal(PVD, PVD);
1003ScopeForParameters->MakeInstantiatedLocalArgPack(PVD);
1004ScopeForParameters->InstantiatedLocalPackArg(PVD, PVD);
1008std::optional<Sema::CXXThisScopeRAII> ThisScope;
1017std::optional<Sema::ContextRAII> ContextScope;
1025 if(
auto*RD = dyn_cast<CXXRecordDecl>(DC)) {
1027ContextScope.emplace(S,
const_cast<DeclContext*
>(cast<DeclContext>(RD)),
1037 returnSubstConstr.
get();
1041 const Expr*OldConstr,
1043 const Expr*NewConstr) {
1044 if(OldConstr == NewConstr)
1049 if(
const Expr*SubstConstr =
1052OldConstr = SubstConstr;
1055 if(
const Expr*SubstConstr =
1058NewConstr = SubstConstr;
1063llvm::FoldingSetNodeID ID1, ID2;
1076 "Non-function templates don't need to be checked");
1082 for(
const Expr*Constraint : ACs)
1097TemplateIDRange, Satisfaction))
1102TemplateArgString =
" ";
1108diag::err_template_arg_list_constraints_not_satisfied)
1110<< TemplateArgString << TemplateIDRange;
1127 if(TemplateAC.empty()) {
1137std::optional<MultiLevelTemplateArgumentList> MLTAL =
1138SetupConstraintCheckingTemplateArgumentsAndScope(
Decl, TemplateArgs,
1146 if(
auto*Method = dyn_cast<CXXMethodDecl>(
Decl)) {
1147ThisQuals = Method->getMethodQualifiers();
1148 Record= Method->getParent();
1157PointOfInstantiation, Satisfaction);
1164&&
"Diagnose() can only be used on an unsatisfied requirement");
1167llvm_unreachable(
"Diagnosing a dependent requirement");
1171 if(!SubstDiag->DiagMessage.empty())
1172S.
Diag(SubstDiag->DiagLoc,
1173diag::note_expr_requirement_expr_substitution_error)
1174<< (
int)
First<< SubstDiag->SubstitutedEntity
1175<< SubstDiag->DiagMessage;
1177S.
Diag(SubstDiag->DiagLoc,
1178diag::note_expr_requirement_expr_unknown_substitution_error)
1179<< (
int)
First<< SubstDiag->SubstitutedEntity;
1184diag::note_expr_requirement_noexcept_not_met)
1190 if(!SubstDiag->DiagMessage.empty())
1191S.
Diag(SubstDiag->DiagLoc,
1192diag::note_expr_requirement_type_requirement_substitution_error)
1193<< (
int)
First<< SubstDiag->SubstitutedEntity
1194<< SubstDiag->DiagMessage;
1196S.
Diag(SubstDiag->DiagLoc,
1197diag::note_expr_requirement_type_requirement_unknown_substitution_error)
1198<< (
int)
First<< SubstDiag->SubstitutedEntity;
1209diag::note_expr_requirement_constraints_not_satisfied_simple)
1214diag::note_expr_requirement_constraints_not_satisfied)
1215<< (
int)
First<< ConstraintExpr;
1221llvm_unreachable(
"We checked this above");
1229&&
"Diagnose() can only be used on an unsatisfied requirement");
1232llvm_unreachable(
"Diagnosing a dependent requirement");
1236 if(!SubstDiag->DiagMessage.empty())
1237S.
Diag(SubstDiag->DiagLoc,
1238diag::note_type_requirement_substitution_error) << (
int)
First 1239<< SubstDiag->SubstitutedEntity << SubstDiag->DiagMessage;
1241S.
Diag(SubstDiag->DiagLoc,
1242diag::note_type_requirement_unknown_substitution_error)
1243<< (
int)
First<< SubstDiag->SubstitutedEntity;
1247llvm_unreachable(
"Unknown satisfaction status");
1253 bool First=
true);
1258 usingSubstitutionDiagnostic = std::pair<SourceLocation, StringRef>;
1260 if(
auto*SubstDiag =
Record.dyn_cast<SubstitutionDiagnostic *>())
1261S.
Diag(SubstDiag->first, diag::note_nested_requirement_substitution_error)
1263<< SubstDiag->second;
1276 switch(BO->getOpcode()) {
1288BO->getLHS()->EvaluateKnownConstInt(S.
Context).getBoolValue();
1299BO->getRHS()->EvaluateKnownConstInt(S.
Context).getBoolValue();
1311 if(BO->getLHS()->getType()->isIntegerType() &&
1312BO->getRHS()->getType()->isIntegerType()) {
1315BO->getLHS()->EvaluateAsInt(SimplifiedLHS, S.
Context,
1318BO->getRHS()->EvaluateAsInt(SimplifiedRHS, S.
Context,
1321 if(!SimplifiedLHS.
Diag&& ! SimplifiedRHS.
Diag) {
1323diag::note_atomic_constraint_evaluated_to_false_elaborated)
1336}
else if(
auto*CSE = dyn_cast<ConceptSpecializationExpr>(SubstExpr)) {
1337 if(CSE->getTemplateArgsAsWritten()->NumTemplateArgs == 1) {
1339CSE->getSourceRange().getBegin(),
1341note_single_arg_concept_specialization_constraint_evaluated_to_false)
1343<< CSE->getTemplateArgsAsWritten()->arguments()[0].getArgument()
1344<< CSE->getNamedConcept();
1347diag::note_concept_specialization_constraint_evaluated_to_false)
1348<< (
int)
First<< CSE;
1352}
else if(
auto*RE = dyn_cast<RequiresExpr>(SubstExpr)) {
1355 if(!Req->isDependent() && !Req->isSatisfied()) {
1356 if(
auto*
E= dyn_cast<concepts::ExprRequirement>(Req))
1358 else if(
auto*
T= dyn_cast<concepts::TypeRequirement>(Req))
1362S, cast<concepts::NestedRequirement>(Req),
First);
1366}
else if(
auto*TTE = dyn_cast<TypeTraitExpr>(SubstExpr);
1367TTE && TTE->getTrait() == clang::TypeTrait::BTT_IsDeducible) {
1368assert(TTE->getNumArgs() == 2);
1370diag::note_is_deducible_constraint_evaluated_to_false)
1371<< TTE->getArg(0)->getType() << TTE->getArg(1)->getType();
1376diag::note_atomic_constraint_evaluated_to_false)
1380template<
typenameSubstitutionDiagnostic>
1382 Sema&S,
constllvm::PointerUnion<Expr *, SubstitutionDiagnostic *> &
Record,
1383 bool First=
true) {
1384 if(
auto*
Diag=
Record.template dyn_cast<SubstitutionDiagnostic *>()) {
1385S.
Diag(
Diag->first, diag::note_substituted_constraint_expr_is_ill_formed)
1397 "Attempted to diagnose a satisfied constraint");
1408 "Attempted to diagnose a satisfied constraint");
1409 for(
auto&
Record: Satisfaction) {
1423 autoCacheEntry = NormalizationCache.find(ConstrainedDecl);
1424 if(CacheEntry == NormalizationCache.end()) {
1426NormalizedConstraint::fromConstraintExprs(*
this, ConstrainedDecl,
1427AssociatedConstraints);
1430.try_emplace(ConstrainedDecl,
1433std::move(*Normalized))
1437 returnCacheEntry->second;
1444AssociatedConstraints);
1472 if(!
Atomic.ParameterMapping) {
1473llvm::SmallBitVector OccurringIndices(TemplateParams->
size());
14750, OccurringIndices);
1478 for(
unsignedI = 0, J = 0,
C= TemplateParams->
size(); I !=
C; ++I)
1479 if(OccurringIndices[I])
1480 new(&(TempArgs)[J++])
1482TemplateParams->
begin()[I],
1492? ArgsAsWritten->
arguments()[I].getLocation()
1494 Atomic.ParameterMapping.emplace(TempArgs, OccurringIndices.count());
1499: ArgsAsWritten->
arguments().front().getSourceRange().getBegin();
1503: ArgsAsWritten->
arguments().front().getSourceRange().getEnd();
1507 Atomic.ConstraintDecl, {InstLocBegin, InstLocEnd});
1508 if(Inst.isInvalid())
1517 Atomic.ParameterMapping.emplace(TempArgs, SubstArgs.
size());
1544 if(
Other.isAtomic()) {
1546}
else if(
Other.isFoldExpanded()) {
1548 Other.getFoldExpandedConstraint()->Kind,
1550 Other.getFoldExpandedConstraint()->Pattern);
1556 Other.getCompoundKind());
1561assert(
isCompound() &&
"getLHS called on a non-compound constraint.");
1562 returncast<CompoundConstraint>(
Constraint).getPointer()->LHS;
1566assert(
isCompound() &&
"getRHS called on a non-compound constraint.");
1567 returncast<CompoundConstraint>(
Constraint).getPointer()->RHS;
1570std::optional<NormalizedConstraint>
1571NormalizedConstraint::fromConstraintExprs(
Sema&S,
NamedDecl*
D,
1573assert(
E.size() != 0);
1574 autoConjunction = fromConstraintExpr(S,
D,
E[0]);
1576 returnstd::nullopt;
1577 for(
unsignedI = 1; I <
E.size(); ++I) {
1578 autoNext = fromConstraintExpr(S,
D,
E[I]);
1580 returnstd::nullopt;
1587std::optional<NormalizedConstraint>
1589assert(
E!=
nullptr);
1602 if(LogicalBinOp BO =
E) {
1603 autoLHS = fromConstraintExpr(S,
D, BO.getLHS());
1605 returnstd::nullopt;
1606 autoRHS = fromConstraintExpr(S,
D, BO.getRHS());
1608 returnstd::nullopt;
1612}
else if(
auto*CSE = dyn_cast<const ConceptSpecializationExpr>(
E)) {
1616S, CSE->getExprLoc(),
1619 if(Inst.isInvalid())
1620 returnstd::nullopt;
1634 returnstd::nullopt;
1637std::optional<NormalizedConstraint> New;
1638New.emplace(S.
Context, *SubNF);
1641 returnstd::nullopt;
1644}
else if(
auto*FE = dyn_cast<const CXXFoldExpr>(
E);
1646(FE->getOperator() == BinaryOperatorKind::BO_LAnd ||
1647FE->getOperator() == BinaryOperatorKind::BO_LOr)) {
1652FE->getOperator() == BinaryOperatorKind::BO_LAnd
1656 if(FE->getInit()) {
1657 autoLHS = fromConstraintExpr(S,
D, FE->getLHS());
1658 autoRHS = fromConstraintExpr(S,
D, FE->getRHS());
1660 returnstd::nullopt;
1662 if(FE->isRightFold())
1664 Kind, std::move(*RHS), FE->getPattern()}};
1667 Kind, std::move(*LHS), FE->getPattern()}};
1670S.
Context, std::move(*LHS), std::move(*RHS),
1674 auto Sub= fromConstraintExpr(S,
D, FE->getPattern());
1676 returnstd::nullopt;
1678 Kind, std::move(*Sub), FE->getPattern()}};
1700 if(it != BPacks.end())
1716LCNF.reserve(LCNF.size() + RCNF.size());
1717 while(!RCNF.empty())
1718LCNF.push_back(RCNF.pop_back_val());
1724Res.reserve(LCNF.size() * RCNF.size());
1725 for(
auto&LDisjunction : LCNF)
1726 for(
auto&RDisjunction : RCNF) {
1727NormalForm::value_type Combined;
1728Combined.reserve(LDisjunction.size() + RDisjunction.size());
1729std::copy(LDisjunction.begin(), LDisjunction.end(),
1730std::back_inserter(Combined));
1731std::copy(RDisjunction.begin(), RDisjunction.end(),
1732std::back_inserter(Combined));
1733Res.emplace_back(Combined);
1748LDNF.reserve(LDNF.size() + RDNF.size());
1749 while(!RDNF.empty())
1750LDNF.push_back(RDNF.pop_back_val());
1756Res.reserve(LDNF.size() * RDNF.size());
1757 for(
auto&LConjunction : LDNF) {
1758 for(
auto&RConjunction : RDNF) {
1759NormalForm::value_type Combined;
1760Combined.reserve(LConjunction.size() + RConjunction.size());
1761std::copy(LConjunction.begin(), LConjunction.end(),
1762std::back_inserter(Combined));
1763std::copy(RConjunction.begin(), RConjunction.end(),
1764std::back_inserter(Combined));
1765Res.emplace_back(Combined);
1776 if(
const auto*FD1 = dyn_cast<FunctionDecl>(D1)) {
1782 const auto*FD2 = dyn_cast<FunctionDecl>(D2);
1783(void)IsExpectedEntity;
1786assert(IsExpectedEntity(FD1) && FD2 && IsExpectedEntity(FD2) &&
1787 "use non-instantiated function declaration for constraints partial " 1801std::pair<NamedDecl *, NamedDecl *> Key{D1, D2};
1802 autoCacheEntry = SubsumptionCache.find(Key);
1803 if(CacheEntry != SubsumptionCache.end()) {
1804 Result= CacheEntry->second;
1811 for(
size_tI = 0; I != AC1.size() && I != AC2.size(); ++I) {
1812 if(Depth2 > Depth1) {
1813AC1[I] = AdjustConstraintDepth(*
this, Depth2 - Depth1)
1814.TransformExpr(
const_cast<Expr*
>(AC1[I]))
1816}
else if(Depth1 > Depth2) {
1817AC2[I] = AdjustConstraintDepth(*
this, Depth1 - Depth2)
1818.TransformExpr(
const_cast<Expr*
>(AC2[I]))
1824*
this, D1, AC1, D2, AC2,
Result,
1829SubsumptionCache.try_emplace(Key,
Result);
1839 if(AC1.empty() || AC2.empty())
1842 autoNormalExprEvaluator =
1847 const Expr*AmbiguousAtomic1 =
nullptr, *AmbiguousAtomic2 =
nullptr;
1848 autoIdenticalExprEvaluator =
1858llvm::FoldingSetNodeID IDA, IDB;
1860EB->Profile(IDB,
Context,
true);
1864AmbiguousAtomic1 = EA;
1865AmbiguousAtomic2 = EB;
1884 boolIs1AtLeastAs2Normally =
1886 boolIs2AtLeastAs1Normally =
1888 boolIs1AtLeastAs2 =
clang::subsumes(DNF1, CNF2, IdenticalExprEvaluator);
1889 boolIs2AtLeastAs1 =
clang::subsumes(DNF2, CNF1, IdenticalExprEvaluator);
1890 if(Is1AtLeastAs2 == Is1AtLeastAs2Normally &&
1891Is2AtLeastAs1 == Is2AtLeastAs1Normally)
1897assert(AmbiguousAtomic1 && AmbiguousAtomic2);
1899 Diag(AmbiguousAtomic1->
getBeginLoc(), diag::note_ambiguous_atomic_constraints)
1901 Diag(AmbiguousAtomic2->getBeginLoc(),
1902diag::note_ambiguous_atomic_constraints_similar_expression)
1903<< AmbiguousAtomic2->getSourceRange();
1911 Requirement(IsSimple ? RK_Simple : RK_Compound, Status == SS_Dependent,
1912Status == SS_Dependent &&
1913(
E->containsUnexpandedParameterPack() ||
1914Req.containsUnexpandedParameterPack()),
1915Status == SS_Satisfied),
Value(
E), NoexceptLoc(NoexceptLoc),
1916TypeReq(Req), SubstitutedConstraintExpr(SubstitutedConstraintExpr),
1919 "Simple requirement must not have a return type requirement or a " 1920 "noexcept specification");
1922(SubstitutedConstraintExpr !=
nullptr));
1928 Requirement(IsSimple ? RK_Simple : RK_Compound, Req.isDependent(),
1929Req.containsUnexpandedParameterPack(),
false),
1930 Value(ExprSubstDiag), NoexceptLoc(NoexceptLoc), TypeReq(Req),
1931Status(SS_ExprSubstitutionFailure) {
1933 "Simple requirement must not have a return type requirement or a " 1934 "noexcept specification");
1939TypeConstraintInfo(TPL,
false) {
1940assert(TPL->
size() == 1);
1942cast<TemplateTypeParmDecl>(TPL->
getParam(0))->getTypeConstraint();
1944 "TPL must have a template type parameter with a type constraint");
1948Constraint->getTemplateArgsAsWritten() &&
1950Constraint->getTemplateArgsAsWritten()->arguments().drop_front(1));
1951TypeConstraintInfo.setInt(
Dependent?
true:
false);
1962Status(
T->getType()->isInstantiationDependentType() ?
SS_Dependent 1967assert(isCompound() &&
"getCompoundKind on a non-compound constraint..");
1968 returncast<CompoundConstraint>(Constraint).getInt();
1972assert(isAtomic() &&
"getAtomicConstraint called on non-atomic constraint.");
1973 returncast<AtomicConstraint *>(Constraint);
1978assert(isFoldExpanded() &&
1979 "getFoldExpandedConstraint called on non-fold-expanded constraint.");
1980 returncast<FoldExpandedConstraint *>(Constraint);
This file provides some common utility functions for processing Lambda related AST Constructs.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines Expressions and AST nodes for C++2a concepts.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
llvm::MachO::Record Record
Defines and computes precedence levels for binary/ternary operators.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
static bool CheckConstraintSatisfaction(Sema &S, const NamedDecl *Template, ArrayRef< const Expr * > ConstraintExprs, llvm::SmallVectorImpl< Expr * > &Converted, const MultiLevelTemplateArgumentList &TemplateArgsLists, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction)
static const Expr * SubstituteConstraintExpressionWithoutSatisfaction(Sema &S, const Sema::TemplateCompareNewDeclInfo &DeclInfo, const Expr *ConstrExpr)
static ExprResult calculateConstraintSatisfaction(Sema &S, const Expr *ConstraintExpr, ConstraintSatisfaction &Satisfaction, const ConstraintEvaluator &Evaluator)
static bool DiagRecursiveConstraintEval(Sema &S, llvm::FoldingSetNodeID &ID, const NamedDecl *Templ, const Expr *E, const MultiLevelTemplateArgumentList &MLTAL)
static void diagnoseWellFormedUnsatisfiedConstraintExpr(Sema &S, Expr *SubstExpr, bool First=true)
static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::ExprRequirement *Req, bool First)
static bool substituteParameterMappings(Sema &S, NormalizedConstraint &N, ConceptDecl *Concept, const MultiLevelTemplateArgumentList &MLTAL, const ASTTemplateArgumentListInfo *ArgsAsWritten)
static void diagnoseUnsatisfiedConstraintExpr(Sema &S, const llvm::PointerUnion< Expr *, SubstitutionDiagnostic * > &Record, bool First=true)
static unsigned CalculateTemplateDepthForConstraints(Sema &S, const NamedDecl *ND, bool SkipForSpecialization=false)
static bool isInvalid(LocType Loc, bool *Invalid)
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getReferenceQualifiedType(const Expr *e) const
getReferenceQualifiedType - Given an expr, will return the type for that expression,...
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
SourceLocation getBeginLoc() const LLVM_READONLY
A builtin binary operation expression such as "x + y" or "x <= y".
static OverloadedOperatorKind getOverloadedOperator(Opcode Opc)
Retrieve the overloaded operator kind that corresponds to the given binary opcode.
StringRef getOpcodeStr() const
static BinaryOperator * Create(const ASTContext &C, Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, FPOptionsOverride FPFeatures)
static Opcode getOverloadedOpcode(OverloadedOperatorKind OO)
Retrieve the binary opcode that corresponds to the given overloaded operator.
Represents a C++ conversion function within a class.
Represents a folding of a pack over an operator.
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getInit() const
Get the operand that doesn't contain a pack, for a binary fold.
std::optional< unsigned > getNumExpansions() const
SourceLocation getEllipsisLoc() const
bool isLeftFold() const
Does this produce a left-associated sequence of operators?
bool isRightFold() const
Does this produce a right-associated sequence of operators?
Expr * getPattern() const
Get the pattern, that is, the operand that contains an unexpanded pack.
BinaryOperatorKind getOperator() const
Represents a C++ struct/union/class.
Declaration of a C++20 concept.
Expr * getConstraintExpr() const
Represents the specialization of a concept - evaluates to a prvalue of type bool.
SourceLocation getBeginLoc() const LLVM_READONLY
ArrayRef< TemplateArgument > getTemplateArguments() const
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments' satisfaction of the named concept.
ConceptDecl * getNamedConcept() const
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
std::pair< SourceLocation, StringRef > SubstitutionDiagnostic
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C)
llvm::SmallVector< Detail, 4 > Details
The substituted constraint expr, if the template arguments could be substituted into them,...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
bool isTransparentContext() const
isTransparentContext - Determines whether this context is a "transparent" context,...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
DeclContext * getNonTransparentContext()
Decl - This represents one declaration (or definition), e.g.
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
bool isFunctionOrFunctionTemplate() const
Whether this declaration is a function or function template.
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
bool isInvalidDecl() const
SourceLocation getLocation() const
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Expr * getTrailingRequiresClause()
Get the constraint-expression introduced by the trailing requires-clause in the function/member decla...
RAII object that enters a new expression evaluation context.
This represents one expression.
@ SE_NoSideEffects
Strictly evaluate the expression.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Expr * IgnoreParenImpCasts() LLVM_READONLY
Skip past any parentheses and implicit casts which might surround this expression until reaching a fi...
bool containsErrors() const
Whether this expression contains subexpressions which had errors, e.g.
bool EvaluateAsConstantExpr(EvalResult &Result, const ASTContext &Ctx, ConstantExprKind Kind=ConstantExprKind::Normal) const
Evaluate an expression that is required to be a constant expression.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
Represents difference between two FPOptions values.
Represents a function declaration or definition.
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
SourceLocation getPointOfInstantiation() const
Retrieve the (first) point of instantiation of a function template specialization or a member of a cl...
ArrayRef< ParmVarDecl * > parameters() const
FunctionTemplateDecl * getPrimaryTemplate() const
Retrieve the primary template that this function template specialization either specializes or was in...
const TemplateArgumentList * getTemplateSpecializationArgs() const
Retrieve the template arguments used to produce this function template specialization from the primar...
bool isTemplateInstantiation() const
Determines if the given function was instantiated from a function template.
TemplatedKind
The kind of templated function a FunctionDecl can be.
@ TK_MemberSpecialization
@ TK_DependentNonTemplate
@ TK_FunctionTemplateSpecialization
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
FunctionDecl * getInstantiatedFromDecl() const
FunctionDecl * getInstantiatedFromMemberFunction() const
If this function is an instantiation of a member function of a class template specialization,...
Declaration of a template function.
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
FunctionTemplateDecl * getInstantiatedFromMemberTemplate() const
static ImplicitCastExpr * Create(const ASTContext &Context, QualType T, CastKind Kind, Expr *Operand, const CXXCastPath *BasePath, ExprValueKind Cat, FPOptionsOverride FPO)
const TypeClass * getTypePtr() const
Describes the capture of a variable or of this, or of a C++1y init-capture.
A stack-allocated class that identifies which local variable declaration instantiations are present i...
Data structure that captures multiple levels of template argument lists for use in template instantia...
const ArgList & getInnermost() const
Retrieve the innermost template argument list.
unsigned getNumLevels() const
Determine the number of levels in this template argument list.
unsigned getNumSubstitutedLevels() const
Determine the number of substituted levels in this template argument list.
const ArgList & getOutermost() const
Retrieve the outermost template argument list.
bool isAnyArgInstantiationDependent() const
This represents a decl that may have a name.
void EmitToString(DiagnosticsEngine &Diags, SmallVectorImpl< char > &Buf) const
A (possibly-)qualified type.
The collection of all-type qualifiers we support.
Scope - A scope is a transient data structure that is used while parsing the program.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
RAII object used to change the argument pack substitution index within a Sema object.
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
RAII class used to determine whether SFINAE has trapped any errors that occur during template argumen...
bool hasErrorOccurred() const
Determine whether any SFINAE errors have been trapped.
SourceLocation getLocation() const
bool ContainsDecl(const NamedDecl *ND) const
const DeclContext * getDeclContext() const
const NamedDecl * getDecl() const
const DeclContext * getLexicalDeclContext() const
Sema - This implements semantic analysis and AST building for C.
bool CheckInstantiatedFunctionTemplateConstraints(SourceLocation PointOfInstantiation, FunctionDecl *Decl, ArrayRef< TemplateArgument > TemplateArgs, ConstraintSatisfaction &Satisfaction)
bool CheckParameterPacksForExpansion(SourceLocation EllipsisLoc, SourceRange PatternRange, ArrayRef< UnexpandedParameterPack > Unexpanded, const MultiLevelTemplateArgumentList &TemplateArgs, bool &ShouldExpand, bool &RetainExpansion, std::optional< unsigned > &NumExpansions)
Determine whether we could expand a pack expansion with the given set of parameter packs into separat...
bool ConstraintExpressionDependsOnEnclosingTemplate(const FunctionDecl *Friend, unsigned TemplateDepth, const Expr *Constraint)
DiagnosticsEngine & getDiagnostics() const
ExprResult SubstConstraintExprWithoutSatisfaction(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
bool CheckConstraintExpression(const Expr *CE, Token NextToken=Token(), bool *PossibleNonPrimary=nullptr, bool IsTrailingRequiresClause=false)
Check whether the given expression is a valid constraint expression.
bool SubstTemplateArguments(ArrayRef< TemplateArgumentLoc > Args, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateArgumentListInfo &Outputs)
std::optional< unsigned > getNumArgumentsInExpansionFromUnexpanded(llvm::ArrayRef< UnexpandedParameterPack > Unexpanded, const MultiLevelTemplateArgumentList &TemplateArgs)
bool FriendConstraintsDependOnEnclosingTemplate(const FunctionDecl *FD)
bool EnsureTemplateArgumentListConstraints(TemplateDecl *Template, const MultiLevelTemplateArgumentList &TemplateArgs, SourceRange TemplateIDRange)
Ensure that the given template arguments satisfy the constraints associated with the given template,...
const LangOptions & getLangOpts() const
void collectUnexpandedParameterPacks(TemplateArgument Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
Collect the set of unexpanded parameter packs within the given template argument.
bool CheckConstraintSatisfaction(const NamedDecl *Template, ArrayRef< const Expr * > ConstraintExprs, const MultiLevelTemplateArgumentList &TemplateArgLists, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction)
Check whether the given list of constraint expressions are satisfied (as if in a 'conjunction') given...
bool AreConstraintExpressionsEqual(const NamedDecl *Old, const Expr *OldConstr, const TemplateCompareNewDeclInfo &New, const Expr *NewConstr)
sema::FunctionScopeInfo * getCurFunction() const
std::optional< sema::TemplateDeductionInfo * > isSFINAEContext() const
Determines whether we are currently in a context where template argument substitution failures are no...
bool MaybeEmitAmbiguousAtomicConstraintsDiagnostic(NamedDecl *D1, ArrayRef< const Expr * > AC1, NamedDecl *D2, ArrayRef< const Expr * > AC2)
If D1 was not at least as constrained as D2, but would've been if a pair of atomic constraints involv...
MultiLevelTemplateArgumentList getTemplateInstantiationArgs(const NamedDecl *D, const DeclContext *DC=nullptr, bool Final=false, std::optional< ArrayRef< TemplateArgument > > Innermost=std::nullopt, bool RelativeToPrimary=false, const FunctionDecl *Pattern=nullptr, bool ForConstraintInstantiation=false, bool SkipForSpecialization=false, bool ForDefaultArgumentSubstitution=false)
Retrieve the template argument list(s) that should be used to instantiate the definition of the given...
ExprResult PerformContextuallyConvertToBool(Expr *From)
PerformContextuallyConvertToBool - Perform a contextual conversion of the expression From to bool (C+...
bool CheckFunctionConstraints(const FunctionDecl *FD, ConstraintSatisfaction &Satisfaction, SourceLocation UsageLoc=SourceLocation(), bool ForOverloadResolution=false)
Check whether the given function decl's trailing requires clause is satisfied, if any.
TemplateNameKindForDiagnostics getTemplateNameKindForDiagnostics(TemplateName Name)
bool IsAtLeastAsConstrained(NamedDecl *D1, MutableArrayRef< const Expr * > AC1, NamedDecl *D2, MutableArrayRef< const Expr * > AC2, bool &Result)
Check whether the given declaration's associated constraints are at least as constrained than another...
void PushSatisfactionStackEntry(const NamedDecl *D, const llvm::FoldingSetNodeID &ID)
void PopSatisfactionStackEntry()
ExprResult SubstConstraintExpr(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
void MarkUsedTemplateParameters(const Expr *E, bool OnlyDeduced, unsigned Depth, llvm::SmallBitVector &Used)
Mark which template parameters are used in a given expression.
@ ConstantEvaluated
The current context is "potentially evaluated" in C++11 terms, but the expression is evaluated at com...
@ Unevaluated
The current expression and its subexpressions occur within an unevaluated operand (C++11 [expr]p7),...
bool SatisfactionStackContains(const NamedDecl *D, const llvm::FoldingSetNodeID &ID) const
ExprResult BuildEmptyCXXFoldExpr(SourceLocation EllipsisLoc, BinaryOperatorKind Operator)
TemplateArgumentLoc getIdentityTemplateArgumentLoc(NamedDecl *Param, SourceLocation Location)
Get a template argument mapping the given template parameter to itself, e.g.
std::string getTemplateArgumentBindingsText(const TemplateParameterList *Params, const TemplateArgumentList &Args)
Produces a formatted string that describes the binding of template parameters to template arguments.
void DiagnoseUnsatisfiedConstraint(const ConstraintSatisfaction &Satisfaction, bool First=true)
Emit diagnostics explaining why a constraint expression was deemed unsatisfied.
const NormalizedConstraint * getNormalizedAssociatedConstraints(NamedDecl *ConstrainedDecl, ArrayRef< const Expr * > AssociatedConstraints)
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
SourceLocation getBegin() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical, bool ProfileLambdaExpr=false) const
Produce a unique representation of the given statement.
SourceLocation getBeginLoc() const LLVM_READONLY
A convenient class for passing around template argument information.
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
Location wrapper for a TemplateArgument.
The base class of all kinds of template declarations (e.g., class, function, etc.).
void getAssociatedConstraints(llvm::SmallVectorImpl< const Expr * > &AC) const
Get the total constraint-expression associated with this template, including constraint-expressions d...
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Represents a C++ template name within the type system.
Stores a list of template parameters for a TemplateDecl and its derived classes.
NamedDecl * getParam(unsigned Idx)
static bool anyInstantiationDependentTemplateArguments(ArrayRef< TemplateArgumentLoc > Args)
Declaration of a template type parameter.
Wrapper for template type parameters.
Token - This structure provides full information about a lexed token.
bool is(tok::TokenKind K) const
is/isNot - Predicates to check if this token is a specific kind, as in "if (Tok.is(tok::l_brace)) {....
tok::TokenKind getKind() const
A semantic tree transformation that allows one to transform one abstract syntax tree into another.
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
A container of type source information.
SourceLocation getNameLoc() const
void setNameLoc(SourceLocation Loc)
The base class of the type hierarchy.
bool isSpecificBuiltinType(unsigned K) const
Test for a particular builtin type.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isFunctionType() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
ReturnTypeRequirement()
No return type requirement was specified.
bool isTypeConstraint() const
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
A requires-expression requirement which queries the validity and properties of an expression ('simple...
SubstitutionDiagnostic * getExprSubstitutionDiagnostic() const
ConceptSpecializationExpr * getReturnTypeRequirementSubstitutedConstraintExpr() const
@ SS_ConstraintsNotSatisfied
@ SS_TypeRequirementSubstitutionFailure
@ SS_ExprSubstitutionFailure
const ReturnTypeRequirement & getReturnTypeRequirement() const
SatisfactionStatus getSatisfactionStatus() const
SourceLocation getNoexceptLoc() const
ExprRequirement(Expr *E, bool IsSimple, SourceLocation NoexceptLoc, ReturnTypeRequirement Req, SatisfactionStatus Status, ConceptSpecializationExpr *SubstitutedConstraintExpr=nullptr)
Construct a compound requirement.
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
const ASTConstraintSatisfaction & getConstraintSatisfaction() const
StringRef getInvalidConstraintEntity()
A static requirement that can be used in a requires-expression to check properties of types and expre...
bool containsUnexpandedParameterPack() const
A requires-expression requirement which queries the existence of a type name or type template special...
SubstitutionDiagnostic * getSubstitutionDiagnostic() const
SatisfactionStatus getSatisfactionStatus() const
TypeRequirement(TypeSourceInfo *T)
Construct a type requirement from a type.
Provides information about an attempted template argument deduction, whose success or failure was des...
void takeSFINAEDiagnostic(PartialDiagnosticAt &PD)
Take ownership of the SFINAE diagnostic.
bool Sub(InterpState &S, CodePtr OpPC)
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ OO_None
Not an overloaded operator.
NormalForm makeCNF(const NormalizedConstraint &Normalized)
NormalForm makeDNF(const NormalizedConstraint &Normalized)
@ OK_Ordinary
An ordinary object is located at an address in memory.
bool subsumes(const NormalForm &PDNF, const NormalForm &QCNF, const AtomicSubsumptionEvaluator &E)
std::pair< llvm::PointerUnion< const TemplateTypeParmType *, NamedDecl *, ResolvedUnexpandedPackExpr * >, SourceLocation > UnexpandedParameterPack
bool isLambdaCallOperator(const CXXMethodDecl *MD)
@ Result
The result type of a method or function.
std::pair< unsigned, unsigned > getDepthAndIndex(const NamedDecl *ND)
Retrieve the depth and index of a template parameter.
const NormalizedConstraint * getNormalizedAssociatedConstraints(Sema &S, NamedDecl *ConstrainedDecl, ArrayRef< const Expr * > AssociatedConstraints)
prec::Level getBinOpPrecedence(tok::TokenKind Kind, bool GreaterThanIsOperator, bool CPlusPlus11)
Return the precedence of the specified binary operator token.
bool isLambdaConversionOperator(CXXConversionDecl *C)
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
const FunctionProtoType * T
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs.
@ Other
Other implicit parameter.
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
Represents an explicit template argument list in C++, e.g., the "<int>" in "sort<int>".
SourceLocation getLAngleLoc() const
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
SourceLocation getRAngleLoc() const
bool subsumes(ASTContext &C, const AtomicConstraint &Other) const
bool hasMatchingParameterMapping(ASTContext &C, const AtomicConstraint &Other) const
const Expr * ConstraintExpr
EvalResult is a struct with detailed info about an evaluated expression.
APValue Val
Val - This is the value the expression can be folded to.
SmallVectorImpl< PartialDiagnosticAt > * Diag
Diag - If this is non-null, it will be filled in with a stack of notes indicating why evaluation fail...
NormalizedConstraint Constraint
static bool AreCompatibleForSubsumption(const FoldExpandedConstraint &A, const FoldExpandedConstraint &B)
A normalized constraint, as defined in C++ [temp.constr.normal], is either an atomic constraint,...
llvm::PointerUnion< AtomicConstraint *, FoldExpandedConstraint *, CompoundConstraint > Constraint
bool isFoldExpanded() const
NormalizedConstraint & getRHS() const
llvm::PointerIntPair< NormalizedConstraintPair *, 1, CompoundConstraintKind > CompoundConstraint
CompoundConstraintKind getCompoundKind() const
NormalizedConstraint(AtomicConstraint *C)
AtomicConstraint * getAtomicConstraint() const
FoldExpandedConstraint * getFoldExpandedConstraint() const
NormalizedConstraint & getLHS() const
A stack object to be created when performing template instantiation.
bool isInvalid() const
Determines whether we have exceeded the maximum recursive template instantiations.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4