This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gomp4] c++ delete clause

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.

2014-10-20  Cesar Philippidis  <>

	* 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)
   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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]