This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
G++: Clash on TYPENAME
- From: Akim Demaille <akim at epita dot fr>
- To: GCC Bugs <bug-gcc at gnu dot org>
- Date: 27 May 2002 17:56:33 +0200
- Subject: G++: Clash on TYPENAME
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?