Your monthly ICE report

Carlo Wood carlo@runaway.xs4all.nl
Fri Nov 20 06:42:00 GMT 1998


Hiya,

while looking for another bug in egcs-1.1b - I did run into another Internal
Compiler Error.  I will report the bug I was actually looking for in another
mail when I feel more secure that it really is a bug.

Note that this ICE only occurs for a broken C++ source.

>g++ -v copycon.cc 
Reading specs from /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ copycon.cc /tmp/ccm0SDn1.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/egcs/include/g++
 /usr/local/include
 /usr/local/egcs/i686-pc-linux-gnu/include
 /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/include
 /usr/include
End of search list.
 /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/cc1plus /tmp/ccm0SDn1.ii -quiet -dumpbase copycon.cc -version -o /tmp/cc6nksGW.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release) (i686-pc-linux-gnu) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
copycon.cc:6: Internal compiler error.
copycon.cc:6: Please submit a full bug report to `egcs-bugs@cygnus.com'.

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>

==copycon.cc============================================
#include <iostream>

class X;
//template<class X>
class lockable_auto_ptr {
  template<class Y> friend class lockable_auto_ptr;

public:
  explicit lockable_auto_ptr(X*) {
    cerr << "Called lockable_auto_ptr(X*)" << endl;
  }

  // This should be called as copy constructor, right???
  template<class Y>
  lockable_auto_ptr(const lockable_auto_ptr<Y> &) {
    cerr << "Called template<class Y> lockable_auto_ptr(const lockable_auto_ptr<Y> &)" << endl;
  }

  template<class Y>
  lockable_auto_ptr& operator=(const lockable_auto_ptr<Y> &) {
    cerr << "Called template<class Y> lockable_auto_ptr& operator=(const lockable_auto_ptr<Y> &)" << endl;
    return *this;
  }

  ~lockable_auto_ptr() {
    cerr << "Called ~lockable_auto_ptr()" << endl;
  }
};

class alloc_ct {
};

int main(void)
{
  cerr << "Defining lockable_auto_ptr<alloc_ct> x:" << endl;
  lockable_auto_ptr x(new alloc_ct);
  cerr << "Defining lockable_auto_ptr<alloc_ct> y(x):" << endl;
  lockable_auto_ptr y(x); 
  cerr << "Reached end of main()" << endl;
}



More information about the Gcc-bugs mailing list