This is the mail archive of the gcc-bugs@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]

template instatiation ICE new in 1998-07-07


Hi, snapshot 1998-07-07 has an internal compiler error, which was not
previously present (I'm not entirely sure when, but 1.0.3a is ok)

Here's the code,
-- begin code
extern "C" {
typedef unsigned int    size_t;
}

extern "C++" {
inline void *operator new(size_t, void *place) throw() { return place; }
}
template<class T> class BigArray
{
  size_t  num;
  T *array;
public:
  BigArray()   
     throw()  ;
  ~BigArray()  
     throw()  ;
public:
  void Remove(
    size_t ix) 
     throw()  ;
};
template<class T> void BigArray<T>::Remove(size_t ix)
   throw()
{
    T *ptr = &array[ix];
    size_t  pos;
    ptr->~T();
    for(pos = num - 1 - ix; pos--; ptr++)
      {
        (void)new(ptr) T(ptr[1]);
        ptr[1].~T();
      } 
  num--; 
  return;
}
template  class BigArray<char*>  ;
--end code

--begin log
nathan@laie:11128>uname -a
SunOS laie 5.5.1 Generic sun4u sparc SUNW,Ultra-1
nathan@laie:11129>egcs-0707-g++ -v -fno-implicit-templates -c
template.ii  
Reading specs from
/home/staff/nathan/solaris/local/SunOS_5/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.47/specs
gcc version egcs-2.91.47 19980707 (gcc2 ss-980609 experimental)

/home/staff/nathan/solaris/local/SunOS_5/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.91.47/cc1plus
template.ii -quiet -version -fno-implicit-templates -o
/var/tmp/ccTjbZTP.s
GNU C++ version egcs-2.91.47 19980707 (gcc2 ss-980609 experimental)
(sparc-sun-solaris2.5.1) compiled by GNU C version 2.8.1.
template.ii: In method `void BigArray<char *>::Remove<char *>(unsigned
int)':
template.ii:36:   instantiated from here
template.ii:31: Internal compiler error.
template.ii:31: Please submit a full bug report to
`egcs-bugs@cygnus.com'.
--end log

I trust this is sufficient information to reproduce the problem.

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


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