This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[C++] cp_token::type and cp_token::keyword
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: mark at codesourcery dot com
- Cc: gcc at gcc dot gnu dot org
- Date: 01 Dec 2005 00:29:37 +0100
- Subject: [C++] cp_token::type and cp_token::keyword
In cp/parser.c:cp_parser_declaration(), we have the following code
/* Try to figure out what kind of declaration is present. */
token1 = *cp_lexer_peek_token (parser->lexer);
if (token1.type != CPP_EOF)
token2 = *cp_lexer_peek_nth_token (parser->lexer, 2);
else
token2.type = token2.keyword = RID_MAX;
It looks to me like the last line is a typo for
{
token2.type = CPP_EOF;
token2.keyword = RID_MAX;
}
as cp_token::type and cp_token::keyword are of different types and we
don't seem to mix them except at that single place. Is that correct?
-- Gaby
PS: that was caught by a build of cp/parser.c with g++.