This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs/g++ Compiler error when using :: at start of template parameter name
- To: "Smithers, Kit" <kit dot smithers at eds dot com>
- Subject: Re: egcs/g++ Compiler error when using :: at start of template parameter name
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Tue, 20 Apr 1999 18:14:19 +0100
- CC: egcs-bugs at egcs dot cygnus dot com
- Organization: University of Bristol
- References: <F134B35F65F0CF11B9DB00805FD68957A58CE6@GBHDM001>
- Reply-To: nathan at compsci dot bristol dot ac dot uk
Smithers, Kit wrote:
>
> The attached files illustrate a compiler error when using a :: at the start
> of a template parameter:
>
> typedef MyClass<::String> MyStringClass2;
>
> The code can be made to compile by inserting a space between the < and the
> :: as in:
>
> typedef MyClass< ::String> MyStringClass2;
>
> I'm informed that the problem also occurs in egcs1.1.2 although I have only
> personally tried egcs1.1.1
You've stumbled over digraphs. these are described in 2.5/2 of the standard. In
your case the character pair `<:' has the same meaning as `['. Thus you'd
effectively written,
typedef MyClass[:String> MyStringClass2;
So, not a bug.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk