This is the mail archive of the gcc-patches@gcc.gnu.org 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]

PATCH: Initialize keyword


Paolo Carlini reported some bizarre test results after my patch for PR
c++/20293.  We tracked it down to a failure to initialize the keyword
field in the cp_token structure after my patch.  Fixed thusly.

Tested on x86_64-unknown-linux-gnu, applied on the mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2005-11-14  Mark Mitchell  <mark@codesourcery.com>

	* parser.c (cp_lexer_get_preprocessor_token): Initialize keyword
	field.

Index: parser.c
===================================================================
--- parser.c	(revision 106889)
+++ parser.c	(working copy)
@@ -420,7 +420,10 @@ cp_lexer_get_preprocessor_token (cp_lexe
 	  token->value = ridpointers[token->keyword];
 	}
       else
-	token->ambiguous_p = false;
+	{
+	  token->ambiguous_p = false;
+	  token->keyword = RID_MAX;
+	}
     }
   /* Handle Objective-C++ keywords.  */
   else if (token->type == CPP_AT_NAME)


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