diff options
Diffstat (limited to 'clang/lib/Parse')
-rw-r--r-- | clang/lib/Parse/ParseOpenMP.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index 04f29c8..25199c7 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -3311,7 +3311,11 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind, ErrorFound = true; } - Clause = ParseOpenMPClause(CKind, WrongDirective); + if (CKind == OMPC_nowait && PP.LookAhead(/*N=*/0).is(tok::l_paren) && + getLangOpts().OpenMP >= 60) + Clause = ParseOpenMPSingleExprClause(CKind, WrongDirective); + else + Clause = ParseOpenMPClause(CKind, WrongDirective); break; case OMPC_self_maps: // OpenMP [6.0, self_maps clause] diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index bbff627..ec01faf 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -1272,7 +1272,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D, // tokens and store them for late parsing at the end of the translation unit. if (getLangOpts().DelayedTemplateParsing && Tok.isNot(tok::equal) && TemplateInfo.Kind == ParsedTemplateKind::Template && - Actions.canDelayFunctionBody(D)) { + LateParsedAttrs->empty() && Actions.canDelayFunctionBody(D)) { MultiTemplateParamsArg TemplateParameterLists(*TemplateInfo.TemplateParams); ParseScope BodyScope(this, Scope::FnScope | Scope::DeclScope | @@ -1301,10 +1301,8 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D, } return DP; } - else if (CurParsedObjCImpl && - !TemplateInfo.TemplateParams && - (Tok.is(tok::l_brace) || Tok.is(tok::kw_try) || - Tok.is(tok::colon)) && + if (CurParsedObjCImpl && !TemplateInfo.TemplateParams && + (Tok.is(tok::l_brace) || Tok.is(tok::kw_try) || Tok.is(tok::colon)) && Actions.CurContext->isTranslationUnit()) { ParseScope BodyScope(this, Scope::FnScope | Scope::DeclScope | Scope::CompoundStmtScope); @@ -1420,7 +1418,8 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D, // Late attributes are parsed in the same scope as the function body. if (LateParsedAttrs) - ParseLexedAttributeList(*LateParsedAttrs, Res, false, true); + ParseLexedAttributeList(*LateParsedAttrs, Res, /*EnterScope=*/false, + /*OnDefinition=*/true); if (SkipFunctionBodies && (!Res || Actions.canSkipFunctionBody(Res)) && trySkippingFunctionBody()) { |