This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: Clarify declares_class_or_enum in cp/parser.c
- From: Jason Merrill <jason at redhat dot com>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Jan 2004 01:55:10 -0500
- Subject: Re: PATCH RFA: Clarify declares_class_or_enum in cp/parser.c
- References: <20040112005416.2279.qmail@gossamer.airs.com>
On 11 Jan 2004 19:54:16 -0500, Ian Lance Taylor <ian@wasabisystems.com> wrote:
> This minor patch changes a comment in cp/parser.c to clarify how
> declares_class_or_enum is really used in
> cp_parser_decl_specifier_seq(). The text is mostly copied from the
> comment before cp_parser_type_specifier(), which is where
> *declares_class_or_enum is actually set.
I don't think your change to the comment actually says anything different;
an enum-specifier or class-specifier is a definition under the grammar in
the C++ standard. I wouldn't object to a parenthetical clarification, but
I think it's appropriate for the parser to refer to specific nonterminals
from the standard grammar.
> This patch also changes the setting of *declares_class_or_enum in
> cp_parser_type_specifier() to use `0' rather than `false', since the
> value is used as an integer, not a boolean.
This hunk is OK.
> I came up with this patch while looking at the patch in PR c++/4100.
> The patch in that PR uses declares_class_or_enum in a way which did
> not match the comment in the code. Further investigation showed me
> that the comment was wrong, and I am fairly certain that the patch is
> correct. Somebody with authority should approve that patch, and this
> one too.
Yes, that patch looks good. Would you mind checking it in along with
yours?
Jason