diff options
author | Manuel Klimek <klimek@google.com> | 2013-08-22 12:12:24 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-08-22 12:12:24 +0000 |
commit | 2fdbea2819448ecb07ba69c5a70eb49691007880 (patch) | |
tree | ab24c9e98fe9246a5220986c29e031105ad9323c /clang/lib/Parse/ParseDecl.cpp | |
parent | 1559dd8a1cd7cb372046148165a5d0409aff4d82 (diff) | |
download | bcm5719-llvm-2fdbea2819448ecb07ba69c5a70eb49691007880.tar.gz bcm5719-llvm-2fdbea2819448ecb07ba69c5a70eb49691007880.zip |
Revert "Implement a rudimentary form of generic lambdas."
This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.
llvm-svn: 189004
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 4c4ce874822..392535acef2 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -4670,7 +4670,6 @@ void Parser::ParseDirectDeclarator(Declarator &D) { // as part of the parameter-declaration-clause. if (Tok.is(tok::ellipsis) && D.getCXXScopeSpec().isEmpty() && !((D.getContext() == Declarator::PrototypeContext || - D.getContext() == Declarator::LambdaExprParameterContext || D.getContext() == Declarator::BlockLiteralContext) && NextToken().is(tok::r_paren) && !D.hasGroupingParens() && @@ -4989,6 +4988,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D, TypeResult TrailingReturnType; Actions.ActOnStartFunctionDeclarator(); + /* LocalEndLoc is the end location for the local FunctionTypeLoc. EndLoc is the end location for the function declarator. They differ for trailing return types. */ @@ -5009,8 +5009,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D, EndLoc = RParenLoc; } else { if (Tok.isNot(tok::r_paren)) - ParseParameterDeclarationClause(D, FirstArgAttrs, ParamInfo, - EllipsisLoc); + ParseParameterDeclarationClause(D, FirstArgAttrs, ParamInfo, EllipsisLoc); else if (RequiresArg) Diag(Tok, diag::err_argument_required_after_attribute); @@ -5241,6 +5240,7 @@ void Parser::ParseParameterDeclarationClause( ParsedAttributes &FirstArgAttrs, SmallVectorImpl<DeclaratorChunk::ParamInfo> &ParamInfo, SourceLocation &EllipsisLoc) { + while (1) { if (Tok.is(tok::ellipsis)) { // FIXME: Issue a diagnostic if we parsed an attribute-specifier-seq @@ -5270,21 +5270,16 @@ void Parser::ParseParameterDeclarationClause( ParseDeclarationSpecifiers(DS); - - // Parse the declarator. This is "PrototypeContext" or - // "LambdaExprParameterContext", because we must accept either - // 'declarator' or 'abstract-declarator' here. - Declarator ParmDeclarator(DS, - D.getContext() == Declarator::LambdaExprContext ? - Declarator::LambdaExprParameterContext : - Declarator::PrototypeContext); - ParseDeclarator(ParmDeclarator); + // Parse the declarator. This is "PrototypeContext", because we must + // accept either 'declarator' or 'abstract-declarator' here. + Declarator ParmDecl(DS, Declarator::PrototypeContext); + ParseDeclarator(ParmDecl); // Parse GNU attributes, if present. - MaybeParseGNUAttributes(ParmDeclarator); + MaybeParseGNUAttributes(ParmDecl); // Remember this parsed parameter in ParamInfo. - IdentifierInfo *ParmII = ParmDeclarator.getIdentifier(); + IdentifierInfo *ParmII = ParmDecl.getIdentifier(); // DefArgToks is used when the parsing of default arguments needs // to be delayed. @@ -5292,8 +5287,8 @@ void Parser::ParseParameterDeclarationClause( // If no parameter was specified, verify that *something* was specified, // otherwise we have a missing type and identifier. - if (DS.isEmpty() && ParmDeclarator.getIdentifier() == 0 && - ParmDeclarator.getNumTypeObjects() == 0) { + if (DS.isEmpty() && ParmDecl.getIdentifier() == 0 && + ParmDecl.getNumTypeObjects() == 0) { // Completely missing, emit error. Diag(DSStart, diag::err_missing_param); } else { @@ -5302,8 +5297,8 @@ void Parser::ParseParameterDeclarationClause( // Inform the actions module about the parameter declarator, so it gets // added to the current scope. - Decl *Param = Actions.ActOnParamDeclarator(getCurScope(), - ParmDeclarator); + Decl *Param = Actions.ActOnParamDeclarator(getCurScope(), ParmDecl); + // Parse the default argument, if any. We parse the default // arguments in all dialects; the semantic analysis in // ActOnParamDefaultArgument will reject the default argument in @@ -5364,8 +5359,8 @@ void Parser::ParseParameterDeclarationClause( } ParamInfo.push_back(DeclaratorChunk::ParamInfo(ParmII, - ParmDeclarator.getIdentifierLoc(), - Param, DefArgToks)); + ParmDecl.getIdentifierLoc(), Param, + DefArgToks)); } // If the next token is a comma, consume it and keep reading arguments. |