This is the mail archive of the gcc-patches@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]

Re: Patch for %E formatting for C


On Sun, 2 Oct 2004, Gabriel Dos Reis wrote:

> Also, %E really is for expressions, and identifiers are also
> expressions.  There is no need to introduce artifical distinction and
> comment #4 is right.

Although syntactically they are one case of expressions, at the level of 
trees they have become the DECLs referred to by the identifiers, and an 
IDENTIFIER_NODE is not something that should appear as an expression 
operand in C.  Keeping in mind Nathan and Zack's proposal:

    With the exception of C++ template bodies, there are only a
    few places where a tree node might or might not be an
    identifier, and they are all arguably bugs.  The new C++ parser should
    make it feasible to use custom data structures for C++ template
    bodies, so that IDENTIFIER_NODE need not be an overloading candidate
    at all. In some places, identifiers are used where unboxed strings
    would suffice; we will remove all such identifiers in this step.

(p162 of the 2004 summit proceedings), the distinction seems far from 
artificial, and a separate format for identifiers (e.g. %I) in due course 
desirable.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
  http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 4.0
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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