[gcc-in-cxx] Fix cp/parser.c for C++

Thomas Neumann tneumann@users.sourceforge.net
Wed Feb 18 13:12:00 GMT 2009


The patch below adds a missing cast to enum to cp/parser.c. As the already
existing comment mentions, the enum value is smuggled as int value through
the tree.

Ok to commit?

Thomas

* cp/parser.c (cp_lexer_get_preprocessor_token): Add missing cast to enum.

diff --git gcc/cp/parser.c gcc/cp/parser.c
--- gcc/cp/parser.c  (revision 144249)
+++ gcc/cp/parser.c  (working copy)
@@ -470,7 +470,7 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
   else if (token->type == CPP_PRAGMA)
     {
       /* We smuggled the cpp_token->u.pragma value in an INTEGER_CST.  */
-      token->pragma_kind = TREE_INT_CST_LOW (token->u.value);
+      token->pragma_kind = (enum pragma_kind) TREE_INT_CST_LOW (token->u.value);
       token->u.value = NULL_TREE;
     }
 }





More information about the Gcc-patches mailing list