@@ -3637,16 +3637,6 @@ class Sema final {
3637
3637
bool ConsiderCudaAttrs = true,
3638
3638
bool ConsiderRequiresClauses = true);
3639
3639
3640
- // Calculates whether the expression Constraint depends on an enclosing
3641
- // template, for the purposes of [temp.friend] p9.
3642
- // TemplateDepth is the 'depth' of the friend function, which is used to
3643
- // compare whether a declaration reference is referring to a containing
3644
- // template, or just the current friend function. A 'lower' TemplateDepth in
3645
- // the AST refers to a 'containing' template. As the constraint is
3646
- // uninstantiated, this is relative to the 'top' of the TU.
3647
- bool ConstraintExpressionDependsOnEnclosingTemplate(unsigned TemplateDepth,
3648
- const Expr *Constraint);
3649
-
3650
3640
enum class AllowedExplicit {
3651
3641
/// Allow no explicit functions to be used.
3652
3642
None,
@@ -7119,21 +7109,6 @@ class Sema final {
7119
7109
LocalInstantiationScope &Scope,
7120
7110
const MultiLevelTemplateArgumentList &TemplateArgs);
7121
7111
7122
- /// used by SetupConstraintCheckingTemplateArgumentsAndScope to recursively(in
7123
- /// the case of lambdas) set up the LocalInstantiationScope of the current
7124
- /// function.
7125
- bool SetupConstraintScope(
7126
- FunctionDecl *FD, llvm::Optional<ArrayRef<TemplateArgument>> TemplateArgs,
7127
- MultiLevelTemplateArgumentList MLTAL, LocalInstantiationScope &Scope);
7128
-
7129
- /// Used during constraint checking, sets up the constraint template arguemnt
7130
- /// lists, and calls SetupConstraintScope to set up the
7131
- /// LocalInstantiationScope to have the proper set of ParVarDecls configured.
7132
- llvm::Optional<MultiLevelTemplateArgumentList>
7133
- SetupConstraintCheckingTemplateArgumentsAndScope(
7134
- FunctionDecl *FD, llvm::Optional<ArrayRef<TemplateArgument>> TemplateArgs,
7135
- LocalInstantiationScope &Scope);
7136
-
7137
7112
public:
7138
7113
const NormalizedConstraint *
7139
7114
getNormalizedAssociatedConstraints(
@@ -7176,39 +7151,6 @@ class Sema final {
7176
7151
bool CheckConstraintSatisfaction(
7177
7152
const NamedDecl *Template, ArrayRef<const Expr *> ConstraintExprs,
7178
7153
const MultiLevelTemplateArgumentList &TemplateArgLists,
7179
- SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction) {
7180
- llvm::SmallVector<Expr *, 4> Converted;
7181
- return CheckConstraintSatisfaction(Template, ConstraintExprs, Converted,
7182
- TemplateArgLists, TemplateIDRange,
7183
- Satisfaction);
7184
- }
7185
-
7186
- /// \brief Check whether the given list of constraint expressions are
7187
- /// satisfied (as if in a 'conjunction') given template arguments.
7188
- /// Additionally, takes an empty list of Expressions which is populated with
7189
- /// the instantiated versions of the ConstraintExprs.
7190
- /// \param Template the template-like entity that triggered the constraints
7191
- /// check (either a concept or a constrained entity).
7192
- /// \param ConstraintExprs a list of constraint expressions, treated as if
7193
- /// they were 'AND'ed together.
7194
- /// \param ConvertedConstraints a out parameter that will get populated with
7195
- /// the instantiated version of the ConstraintExprs if we successfully checked
7196
- /// satisfaction.
7197
- /// \param TemplateArgList the multi-level list of template arguments to
7198
- /// substitute into the constraint expression. This should be relative to the
7199
- /// top-level (hence multi-level), since we need to instantiate fully at the
7200
- /// time of checking.
7201
- /// \param TemplateIDRange The source range of the template id that
7202
- /// caused the constraints check.
7203
- /// \param Satisfaction if true is returned, will contain details of the
7204
- /// satisfaction, with enough information to diagnose an unsatisfied
7205
- /// expression.
7206
- /// \returns true if an error occurred and satisfaction could not be checked,
7207
- /// false otherwise.
7208
- bool CheckConstraintSatisfaction(
7209
- const NamedDecl *Template, ArrayRef<const Expr *> ConstraintExprs,
7210
- llvm::SmallVectorImpl<Expr *> &ConvertedConstraints,
7211
- const MultiLevelTemplateArgumentList &TemplateArgList,
7212
7154
SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction);
7213
7155
7214
7156
/// \brief Check whether the given non-dependent constraint expression is
@@ -7228,8 +7170,8 @@ class Sema final {
7228
7170
/// \returns true if an error occurred, false otherwise.
7229
7171
bool CheckFunctionConstraints(const FunctionDecl *FD,
7230
7172
ConstraintSatisfaction &Satisfaction,
7231
- SourceLocation UsageLoc = SourceLocation(),
7232
- bool ForOverloadResolution = false);
7173
+ SourceLocation UsageLoc = SourceLocation());
7174
+
7233
7175
7234
7176
/// \brief Ensure that the given template arguments satisfy the constraints
7235
7177
/// associated with the given template, emitting a diagnostic if they do not.
@@ -8985,8 +8927,7 @@ class Sema final {
8985
8927
8986
8928
MultiLevelTemplateArgumentList getTemplateInstantiationArgs(
8987
8929
const NamedDecl *D, const TemplateArgumentList *Innermost = nullptr,
8988
- bool RelativeToPrimary = false, const FunctionDecl *Pattern = nullptr,
8989
- bool LookBeyondLambda = false, bool IncludeContainingStruct = false);
8930
+ bool RelativeToPrimary = false, const FunctionDecl *Pattern = nullptr);
8990
8931
8991
8932
/// A context in which code is being synthesized (where a source location
8992
8933
/// alone is not sufficient to identify the context). This covers template
@@ -9694,21 +9635,23 @@ class Sema final {
9694
9635
const MultiLevelTemplateArgumentList &TemplateArgs,
9695
9636
SourceLocation Loc, DeclarationName Entity);
9696
9637
9697
- TypeSourceInfo *SubstFunctionDeclType(
9698
- TypeSourceInfo *T, const MultiLevelTemplateArgumentList &TemplateArgs,
9699
- SourceLocation Loc, DeclarationName Entity, CXXRecordDecl *ThisContext,
9700
- Qualifiers ThisTypeQuals, bool EvaluateConstraints = true);
9638
+ TypeSourceInfo *SubstFunctionDeclType(TypeSourceInfo *T,
9639
+ const MultiLevelTemplateArgumentList &TemplateArgs,
9640
+ SourceLocation Loc,
9641
+ DeclarationName Entity,
9642
+ CXXRecordDecl *ThisContext,
9643
+ Qualifiers ThisTypeQuals);
9701
9644
void SubstExceptionSpec(FunctionDecl *New, const FunctionProtoType *Proto,
9702
9645
const MultiLevelTemplateArgumentList &Args);
9703
9646
bool SubstExceptionSpec(SourceLocation Loc,
9704
9647
FunctionProtoType::ExceptionSpecInfo &ESI,
9705
9648
SmallVectorImpl<QualType> &ExceptionStorage,
9706
9649
const MultiLevelTemplateArgumentList &Args);
9707
- ParmVarDecl *
9708
- SubstParmVarDecl(ParmVarDecl *D ,
9709
- const MultiLevelTemplateArgumentList &TemplateArgs ,
9710
- int indexAdjustment, Optional<unsigned> NumExpansions,
9711
- bool ExpectParameterPack, bool EvaluateConstraints = true );
9650
+ ParmVarDecl *SubstParmVarDecl(ParmVarDecl *D,
9651
+ const MultiLevelTemplateArgumentList &TemplateArgs ,
9652
+ int indexAdjustment ,
9653
+ Optional<unsigned> NumExpansions,
9654
+ bool ExpectParameterPack );
9712
9655
bool SubstParmTypes(SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,
9713
9656
const FunctionProtoType::ExtParameterInfo *ExtParamInfos,
9714
9657
const MultiLevelTemplateArgumentList &TemplateArgs,
@@ -9718,25 +9661,6 @@ class Sema final {
9718
9661
ExprResult SubstExpr(Expr *E,
9719
9662
const MultiLevelTemplateArgumentList &TemplateArgs);
9720
9663
9721
- // A RAII type used by the TemplateDeclInstantiator and TemplateInstantiator
9722
- // to disable constraint evaluation, then restore the state.
9723
- template <typename InstTy> struct ConstraintEvalRAII {
9724
- InstTy &TI;
9725
- bool OldValue;
9726
-
9727
- ConstraintEvalRAII(InstTy &TI)
9728
- : TI(TI), OldValue(TI.getEvaluateConstraints()) {
9729
- TI.setEvaluateConstraints(false);
9730
- }
9731
- ~ConstraintEvalRAII() { TI.setEvaluateConstraints(OldValue); }
9732
- };
9733
-
9734
- // Unlike the above, this evaluates constraints, which should only happen at
9735
- // 'constraint checking' time.
9736
- ExprResult
9737
- SubstConstraintExpr(Expr *E,
9738
- const MultiLevelTemplateArgumentList &TemplateArgs);
9739
-
9740
9664
/// Substitute the given template arguments into a list of
9741
9665
/// expressions, expanding pack expansions if required.
9742
9666
///
@@ -9766,6 +9690,7 @@ class Sema final {
9766
9690
const MultiLevelTemplateArgumentList &TemplateArgs,
9767
9691
TemplateArgumentListInfo &Outputs);
9768
9692
9693
+
9769
9694
Decl *SubstDecl(Decl *D, DeclContext *Owner,
9770
9695
const MultiLevelTemplateArgumentList &TemplateArgs);
9771
9696
@@ -9856,8 +9781,7 @@ class Sema final {
9856
9781
const MultiLevelTemplateArgumentList &TemplateArgs);
9857
9782
9858
9783
bool SubstTypeConstraint(TemplateTypeParmDecl *Inst, const TypeConstraint *TC,
9859
- const MultiLevelTemplateArgumentList &TemplateArgs,
9860
- bool EvaluateConstraint);
9784
+ const MultiLevelTemplateArgumentList &TemplateArgs);
9861
9785
9862
9786
bool InstantiateDefaultArgument(SourceLocation CallLoc, FunctionDecl *FD,
9863
9787
ParmVarDecl *Param);
0 commit comments