@@ -7103,21 +7103,15 @@ class Sema final {
7103
7103
std::nullopt);
7104
7104
7105
7105
/// Endow the lambda scope info with the relevant properties.
7106
- void buildLambdaScope(sema::LambdaScopeInfo *LSI, CXXMethodDecl *CallOperator,
7106
+ void buildLambdaScope(sema::LambdaScopeInfo *LSI,
7107
+ CXXMethodDecl *CallOperator,
7107
7108
SourceRange IntroducerRange,
7108
7109
LambdaCaptureDefault CaptureDefault,
7109
- SourceLocation CaptureDefaultLoc, bool ExplicitParams,
7110
+ SourceLocation CaptureDefaultLoc,
7111
+ bool ExplicitParams,
7112
+ bool ExplicitResultType,
7110
7113
bool Mutable);
7111
7114
7112
- CXXMethodDecl *CreateLambdaCallOperator(SourceRange IntroducerRange,
7113
- CXXRecordDecl *Class);
7114
- void CompleteLambdaCallOperator(
7115
- CXXMethodDecl *Method, SourceLocation LambdaLoc,
7116
- SourceLocation CallOperatorLoc, Expr *TrailingRequiresClause,
7117
- TypeSourceInfo *MethodTyInfo, ConstexprSpecKind ConstexprKind,
7118
- StorageClass SC, ArrayRef<ParmVarDecl *> Params,
7119
- bool HasExplicitResultType);
7120
-
7121
7115
/// Perform initialization analysis of the init-capture and perform
7122
7116
/// any implicit conversions such as an lvalue-to-rvalue conversion if
7123
7117
/// not being used to initialize a reference.
@@ -7138,9 +7132,11 @@ class Sema final {
7138
7132
///
7139
7133
/// CodeGen handles emission of lambda captures, ignoring these dummy
7140
7134
/// variables appropriately.
7141
- VarDecl *createLambdaInitCaptureVarDecl(
7142
- SourceLocation Loc, QualType InitCaptureType, SourceLocation EllipsisLoc,
7143
- IdentifierInfo *Id, unsigned InitStyle, Expr *Init, DeclContext *DeclCtx);
7135
+ VarDecl *createLambdaInitCaptureVarDecl(SourceLocation Loc,
7136
+ QualType InitCaptureType,
7137
+ SourceLocation EllipsisLoc,
7138
+ IdentifierInfo *Id,
7139
+ unsigned InitStyle, Expr *Init);
7144
7140
7145
7141
/// Add an init-capture to a lambda scope.
7146
7142
void addInitCapture(sema::LambdaScopeInfo *LSI, VarDecl *Var,
@@ -7150,38 +7146,28 @@ class Sema final {
7150
7146
/// given lambda.
7151
7147
void finishLambdaExplicitCaptures(sema::LambdaScopeInfo *LSI);
7152
7148
7153
- /// Deduce a block or lambda's return type based on the return
7154
- /// statements present in the body.
7155
- void deduceClosureReturnType(sema::CapturingScopeInfo &CSI);
7156
-
7157
- /// Once the Lambdas capture are known, we can start to create the closure,
7158
- /// call operator method, and keep track of the captures.
7159
- /// We do the capture lookup here, but they are not actually captured until
7160
- /// after we know what the qualifiers of the call operator are.
7161
- void ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro,
7162
- Scope *CurContext);
7163
-
7164
- /// This is called after parsing the explicit template parameter list
7149
+ /// \brief This is called after parsing the explicit template parameter list
7165
7150
/// on a lambda (if it exists) in C++2a.
7166
- void ActOnLambdaExplicitTemplateParameterList(LambdaIntroducer &Intro,
7167
- SourceLocation LAngleLoc,
7151
+ void ActOnLambdaExplicitTemplateParameterList(SourceLocation LAngleLoc,
7168
7152
ArrayRef<NamedDecl *> TParams,
7169
7153
SourceLocation RAngleLoc,
7170
7154
ExprResult RequiresClause);
7171
7155
7172
- void ActOnLambdaClosureQualifiers(LambdaIntroducer &Intro,
7173
- SourceLocation MutableLoc);
7156
+ /// Introduce the lambda parameters into scope.
7157
+ void addLambdaParameters(
7158
+ ArrayRef<LambdaIntroducer::LambdaCapture> Captures,
7159
+ CXXMethodDecl *CallOperator, Scope *CurScope);
7174
7160
7175
- void ActOnLambdaClosureParameters(
7176
- Scope *LambdaScope,
7177
- MutableArrayRef<DeclaratorChunk::ParamInfo> ParamInfo );
7161
+ /// Deduce a block or lambda's return type based on the return
7162
+ /// statements present in the body.
7163
+ void deduceClosureReturnType(sema::CapturingScopeInfo &CSI );
7178
7164
7179
7165
/// ActOnStartOfLambdaDefinition - This is called just before we start
7180
7166
/// parsing the body of a lambda; it analyzes the explicit captures and
7181
7167
/// arguments, and sets up various data-structures for the body of the
7182
7168
/// lambda.
7183
7169
void ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
7184
- Declarator &ParamInfo, const DeclSpec &DS );
7170
+ Declarator &ParamInfo, Scope *CurScope );
7185
7171
7186
7172
/// ActOnLambdaError - If there is an error parsing a lambda, this callback
7187
7173
/// is invoked to pop the information about the lambda.
@@ -7276,13 +7262,6 @@ class Sema final {
7276
7262
LocalInstantiationScope &Scope,
7277
7263
const MultiLevelTemplateArgumentList &TemplateArgs);
7278
7264
7279
- /// Introduce the instantiated captures of the lambda into the local
7280
- /// instantiation scope.
7281
- bool addInstantiatedCapturesToScope(
7282
- FunctionDecl *Function, const FunctionDecl *PatternDecl,
7283
- LocalInstantiationScope &Scope,
7284
- const MultiLevelTemplateArgumentList &TemplateArgs);
7285
-
7286
7265
/// used by SetupConstraintCheckingTemplateArgumentsAndScope to recursively(in
7287
7266
/// the case of lambdas) set up the LocalInstantiationScope of the current
7288
7267
/// function.
0 commit comments