This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]