This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-1.1.2 template problem?
- To: nbecker at fred dot net
- Subject: Re: egcs-1.1.2 template problem?
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 22 Apr 1999 11:46:26 -0300
- Cc: egcs-bugs at egcs dot cygnus dot com
- References: <x88wvz4u3dh.fsf@nbeckerpc.hns.com>
On Apr 22, 1999, nbecker@fred.net wrote:
> egcs-1.1.2 accepts this test, which actually makes no sense:
Nope, it's correct, because operator= did not have to be
instantiated. If you add an assignment `i=0;' to your program, it'll
complain.
> template<int bits, class Signedness>
> class Int {
[snip]
> if (x > Signedness::Max<bits>())
> Int.H:18: parse error before `('
Once again, it's correct. Because Signedness is a template argument,
you *must* indicate that Max is supposed to be a member template,
otherwise `<' and '>' will be parsed as less-than and greater-than
operators.
if (x > Signedness::template Max<bits>())
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Brasil
{oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists