On 10/20/2014 01:26 PM, Cesar Philippidis wrote:
> On 10/20/2014 01:18 PM, Jakub Jelinek wrote:

>> 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.
> 
> I forgot about private being a keyword in c++. Thanks for the pointer!
> I'll fix the handling of delete accordingly.

That was easy enough. I'll apply this patch to gomp-4_0-branch soon.

Thanks!
Cesar
2014-10-21  Cesar Philippidis  <ce...@codesourcery.com>

	gcc/cp/
	*parser.c (cp_parser_omp_clause_name): Don't parse the
	identifier for RID_DELETE.


diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 153a27f..6e9b919 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -27317,13 +27317,13 @@ cp_parser_omp_clause_name (cp_parser *parser)
     result = PRAGMA_OMP_CLAUSE_IF;
   else if (cp_lexer_next_token_is_keyword (parser->lexer, RID_DEFAULT))
     result = PRAGMA_OMP_CLAUSE_DEFAULT;
+  else if (cp_lexer_next_token_is_keyword (parser->lexer, RID_DELETE))
+    result = PRAGMA_OMP_CLAUSE_DELETE;
   else if (cp_lexer_next_token_is_keyword (parser->lexer, RID_PRIVATE))
     result = PRAGMA_OMP_CLAUSE_PRIVATE;
   else if (cp_lexer_next_token_is_keyword (parser->lexer, RID_FOR))
     result = PRAGMA_OMP_CLAUSE_FOR;
-  /* 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))
+  else if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
     {
       tree id = cp_lexer_peek_token (parser->lexer)->u.value;
       const char *p = IDENTIFIER_POINTER (id);
@@ -27351,9 +27351,7 @@ cp_parser_omp_clause_name (cp_parser *parser)
 	    result = PRAGMA_OMP_CLAUSE_CREATE;
 	  break;
 	case 'd':
-	  if (!strcmp ("delete", p))
-	    result = PRAGMA_OMP_CLAUSE_DELETE;
-	  else if (!strcmp ("depend", p))
+	  if (!strcmp ("depend", p))
 	    result = PRAGMA_OMP_CLAUSE_DEPEND;
 	  else if (!strcmp ("device", p))
 	    result = PRAGMA_OMP_CLAUSE_DEVICE;

Reply via email to