This is the mail archive of the gcc-help@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: template specializiation


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".



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