Internal compiler error in gcc 2.95.2

Gene Bushuyev gbush@synopsys.COM
Fri Dec 31 20:54:00 GMT 1999


The compilation of the following program produces "Internal compiler error"

// -------- file test.cpp ---------------- start---------------
template<class OwnerType, class PropertyType,
  void (OwnerType::*Setter)(const PropertyType&)=0,
  PropertyType (OwnerType::*Getter)()=0>
class EnchancedProperty
{
   OwnerType& theOwner;
   public:
   EnchancedProperty(OwnerType& theOwner): theOwner(theOwner) {}
   void operator = (const PropertyType& value)
   {
           (theOwner.*Setter)(value);
   }
   operator PropertyType()
   {
           return (theOwner.*Getter)();
   }
};

class A
{
  int i;
  virtual void Set(const int& value){i=value;};
  virtual int Get(){return i;};
  public:
  EnchancedProperty<A,int,&A::Set,&A::Get> P_i;
  A():P_i(*this){};
};

int main()
{
  A a;
  a.P_i = 5;
  cout<<a.P_i;
};
// -------- file test.cpp ---------------- end ---------------

gcc -v --save-temps test.cpp
Reading specs from
/remote/montague0/packages/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.5.1/2.9
5.2/specs
gcc version 2.95.2 19991024 (release)

/remote/montague0/packages/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.5.1/2.9
5.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplus
plus -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix
__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(sv
r4) -D__EXCEPTIONS -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc)
test.cpp test.ii
GNU CPP version 2.95.2 19991024 (release) (sparc)
#include "..." search starts here:
#include <...> search starts here:

/remote/montague0/packages/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.5.1/2.9
5.2/../../../../include/g++-3
 /remote/montague0/packages/gcc-2.95.2/include

/remote/montague0/packages/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.5.1/2.9
5.2/../../../../sparc-sun-solaris2.5.1/include

/remote/montague0/packages/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.5.1/2.9
5.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.

/remote/montague0/packages/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.5.1/2.9
5.2/cc1plus test.ii -quiet -dumpbase test.cc -version -o test.s
GNU C++ version 2.95.2 19991024 (release) (sparc-sun-solaris2.5.1) compiled
by GNU C version 2.95.1 19990816 (release).
test.cpp:32: Internal compiler error.
test.cpp:32: Please submit a full bug report.
test.cpp:32: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport >
for instructions.

Compilation exited abnormally with code 1 at Wed Dec 22 19:53:04

----------------
Gene Bushuyev
Entia non sunt multiplicanda praeter necessitatem



More information about the Gcc-bugs mailing list