This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Make parser revert digraph "<:"
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: "Giovanni Bajo" <giovannibajo at libero dot it>
- Cc: "Mark Mitchell" <mark at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: 26 Jan 2004 04:51:50 +0100
- Subject: Re: [C++ PATCH] Make parser revert digraph "<:"
- Organization: Integrable Solutions
- References: <0b6301c3e3ae$a38b35d0$62b92997@bagio>
"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