On Mon, Oct 20, 2014 at 01:12:08PM -0700, Cesar Philippidis wrote:
> The OpenACC delete clause isn't detected in the c++ front end because
> the lexer classifies it as a keyword, which it is. This patch makes the
> openacc pragma parser aware of that.
> 
> I've committed this patch to gomp-4_0-branch. A test case will be
> included in a follow up patch along with support for the acc enter/exit
> data directive.
> 
> Cesar

> 2014-10-20  Cesar Philippidis  <ce...@codesourcery.com>
> 
>       gcc/cp/
>       * parser.c (cp_parser_omp_clause_name): Also consider CPP_KEYWORD
>       typed tokens as clauses for delete.
> 
> 
> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> index 8fd470a..19cbf37 100644
> --- a/gcc/cp/parser.c
> +++ b/gcc/cp/parser.c
> @@ -27321,7 +27321,9 @@ cp_parser_omp_clause_name (cp_parser *parser)
>      result = PRAGMA_OMP_CLAUSE_PRIVATE;
>    else if (cp_lexer_next_token_is_keyword (parser->lexer, RID_FOR))
>      result = PRAGMA_OMP_CLAUSE_FOR;
> -  else if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
> +  /* The lexer classifies "delete" as a keyword.  */
> +  else if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
> +        || cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD))
>      {
>        tree id = cp_lexer_peek_token (parser->lexer)->u.value;
>        const char *p = IDENTIFIER_POINTER (id);

See how private or for clauses are handled earlier, you should
not need to parse identifier to handle RID_DELETE as
PRAGMA_OACC_CLAUSE_DELETE.

        Jakub

Reply via email to