This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: template specializiation
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: Thomas Neumann <tneumann at users dot sourceforge dot net>, gcc-help at gcc dot gnu dot org
- Date: Thu, 07 Jul 2005 08:57:26 -0500
- Subject: Re: template specializiation
- References: <42CD3120.5040906@users.sourceforge.net>
Hi Thomas,
Hmmm, unusual situation (for me).
Using...
http://www.comeaucomputing.com/tryitout/
I tend to trust (EDG's front end) Comeau C++'s error message (strict mode, -tused) on this one.
How to unravel this riddle, I'm not sure. Sorry.
--Eljay
- - - - -
struct A
{
const A* a;
};
template <const char* c>
struct B
{
static const A b;
};
extern const char c[1]="";
extern const char d[1]="";
template<>
const A B<c>::b =
{
&B<d>::b
};
template<>
const A B<d>::b = // Line 21
{
&B<c>::b
};
- - - - -
Comeau C/C++ 4.3.3 (Aug 6 2003 15:13:37) for ONLINE_EVALUATION_BETA1
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:strict errors C++
"ComeauTest.c", line 21: error: explicit specialization of member
"B<c>::b [with c=d]" must precede its first use
const A B<d>::b =
^
"ComeauTest.c", line 24: warning: parsing restarts here after previous syntax error
};
^
1 error detected in the compilation of "ComeauTest.c".