TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
Actions.PushLambdaScope();
+ TypeResult TrailingReturnType;
if (Tok.is(tok::l_paren)) {
ParseScope PrototypeScope(this,
Scope::FunctionPrototypeScope |
SourceLocation FunLocalRangeEnd = DeclEndLoc;
// Parse trailing-return-type[opt].
- TypeResult TrailingReturnType;
if (Tok.is(tok::arrow)) {
FunLocalRangeEnd = Tok.getLocation();
SourceRange Range;
MaybeParseCXX11Attributes(Attr, &DeclEndLoc);
// Parse the return type, if there is one.
- TypeResult TrailingReturnType;
if (Tok.is(tok::arrow)) {
SourceRange Range;
TrailingReturnType = ParseTrailingReturnType(Range);
if (Range.getEnd().isValid())
- DeclEndLoc = Range.getEnd();
+ DeclEndLoc = Range.getEnd();
}
SourceLocation NoLoc;
StmtResult Stmt(ParseCompoundStatementBody());
BodyScope.Exit();
- if (!Stmt.isInvalid())
+ if (!Stmt.isInvalid() && !TrailingReturnType.isInvalid())
return Actions.ActOnLambdaExpr(LambdaBeginLoc, Stmt.get(), getCurScope());
-
+
Actions.ActOnLambdaError(LambdaBeginLoc, getCurScope());
return ExprError();
}