G++: Clash on TYPENAME
Akim Demaille
akim@epita.fr
Mon May 27 08:56:00 GMT 2002
The current CVS Bison outputs the token definitions both as #define,
and as enums. It revealed a name clash in G++, where TYPENAME is both
defined in parse.h because of:
%token TYPENAME
and in gcc/cp/decl.h as part of:
enum decl_context
{ NORMAL, /* Ordinary declaration */
FUNCDEF, /* Function definition */
PARM, /* Declaration of parm before function body */
CATCHPARM, /* Declaration of catch parm */
FIELD, /* Declaration inside struct or union */
BITFIELD, /* Likewise but with specified width */
TYPENAME, /* Typename (inside cast or sizeof) */
MEMFUNCDEF /* Member function definition */
};
I would suggest changing the parser to a less dangerous naming
scheme. Some people use `t*', i.e., tTYPENAME. I propose to write
and send a patch to fix parse.y along these lines (prepending all the
tokens with t). My papers are probably currently arriving on the
FSF's desk.
Would that patch be the one which people would like?
More information about the Gcc-bugs
mailing list