Compile error on specialized templates

Christopher Poblete poblete@lim.com
Fri Jul 23 11:47:00 GMT 1999


Hello,

I am hoping you can help me on a compilation problem. I have implemented
specialized template functions but got the ff. compilation errors (first time
I've seen this; nevertheless I am confident that my implementation is correct.)

Perhaps my version of egcs (below) could not compile specialized templates since 
I can compile the very same code in a Sun machine with "gcc version 2.8.1"!!!


-----[error]---------------------------------------------------------
templates/DynArray_RowElement.C:64: specialization of
DynArray<ExRowElement>::deleteBlocks<ExRowElement>() after instantiation

templates/DynArray_RowElement.C:64: explicit specialization of
DynArray<ExRowElement>::deleteBlocks<ExRowElement>() after first use

-----[compiler]------------------------------------------------------
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

-----[files]---------------------------------------------------------
"util/DynArray.H"
template<class Type>
class DynArray : public DynArrayGeneric
  protected:
    void		deleteBlocks(void);
---------------------------------------------------------------------
"templates/DynArray_RowElement.C"
#include "channel/ch_row_element.H"
#include "util/DynArray.H"
void DynArray<ExRowElement>::deleteBlocks(void)
{
  if (this->ownerP)
  {
    for (int i = 0; i < this->numPages; i++)
      this->deleteBlock(this->vector[i]);
  }

  this->numPages = 0;
}
---------------------------------------------------------------------



More information about the Gcc-bugs mailing list