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: [C++ PATCH] Make parser revert digraph "<:"


"Giovanni Bajo" <giovannibajo@libero.it> writes:

| Hello Mark,
| 
| this patch makes the parser aware that "<:" is a digraph for "[". In other
| words, if the parser sees "A[:0>", where A is a template, it will parse it as
| "A< ::0>", and will emit the following diagnostic:
| 
| error: template parameter list is invalid because `<:' is a digraph for `['
| note: use `< ::' to avoid forming the digraph

I would rather see the diagnostic as

  error: check the spelling of the template-argument list; '<:' is a
    digraph (another spelling for '[').  Insert a whitespace between
    '<' and '::'.

Notice that there is a difference between a template-paramater list
and a template-argument list.  Also what is invalid is not the 
template-argument list per se; rather it is the missing whitespace
between the opening '<' and the scope operator '::'. 

-- Gaby


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