This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Initialize keyword
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Nov 2005 16:06:00 -0800
- Subject: PATCH: Initialize keyword
- Reply-to: mark at codesourcery dot com
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)