summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-26 09:20:14 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-26 09:20:14 +0000
commit61cc302f5a015821553715bec582a849cc0c5fb0 (patch)
tree8b1dcd7ea7fe58c697f075ec9c7cdad1138aaa85 /gcc/cp
parentc473c16ad275322789d3e33eeff3f9bafcecdce9 (diff)
downloadgcc-61cc302f5a015821553715bec582a849cc0c5fb0.tar.gz
* c-lex.c (get_nonpadding_token): Remove.
(c_lex_with_flags): Push timevar and eat padding here. Improve stray token diagnostic. (lex_string): Replace logic with switch statement, eat padding token here. * cp/parser.c (cp_lexer_get_preprocessor_token): Remove unneeded padding token checking. testsuite: * gcc.dg/cpp/direct2.c: Adjust expected errors, robustify parser resyncing. * gcc.dg/cpp/direct2s.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89577 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c25
2 files changed, 7 insertions, 23 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8e759ff5f91..39f6e4127ef 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * parser.c (cp_lexer_get_preprocessor_token): Remove unneeded
+ padding token checking.
+
2004-10-25 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/18121
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 7109862b2dd..fe3b3c61744 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -374,30 +374,9 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED ,
cp_token *token)
{
static int is_extern_c = 0;
- bool done;
- done = false;
- /* Keep going until we get a token we like. */
- while (!done)
- {
- /* Get a new token from the preprocessor. */
- token->type = c_lex_with_flags (&token->value, &token->flags);
- /* Issue messages about tokens we cannot process. */
- switch (token->type)
- {
- case CPP_ATSIGN:
- case CPP_HASH:
- case CPP_PASTE:
- error ("invalid token");
- break;
-
- default:
- /* This is a good token, so we exit the loop. */
- done = true;
- break;
- }
- }
- /* Now we've got our token. */
+ /* Get a new token from the preprocessor. */
+ token->type = c_lex_with_flags (&token->value, &token->flags);
token->location = input_location;
token->in_system_header = in_system_header;