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]

ICE with egcs-19990607 (gcc 2.95 branch)


Trying to torture C++ compiler 
(gcc-2.95 19990607 (prerelease))
to reproduce problems with accessing class members found 
following internal compiler error. egcs-1.1.2 simply gives warning message
without ICE

bad.cc:27: warning: direct base `vector<int,allocator<int> >' inaccessible in `B' due to ambiguity
bad.cc: In method `B::B()':
bad.cc:54: Internal compiler error 980827.
bad.cc:54: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
bad.cc:54: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.


Andris


#include <stdio.h>
#include <vector>

class   V
  {
  public:
         char   f1;
  };

class   A :  virtual V
, public vector <int>
  {
  public:
         char   x1;
         double x2;
	 char   x3;
  };


class   B : public A, virtual V, public vector <int>
  {
  public:
         short  y1;
         A      yy1;
         double y2;
	 char   y3;
         virtual  void  bar (void) {}
  };


class   C
  {
  public:
         char   z1;
         A      z2;
         B      z3;

         C (void);
         virtual  void  foo (void)
                  {
                  }
                  
         virtual  void  dumpaddr (void)
                  {
                      printf ("From member function : %p %p %p\n",
                              &z1,&z2,&z3);
                  }
  };


C * cLoc = 0;


C::C (void)
  {
        cLoc = this;
  }


int main (void)
  {
        C       xx;
        xx.dumpaddr ();
        printf ("From outside         : %p %p %p\n",
                              &cLoc->z1,&cLoc->z2,&cLoc->z3);
        return 0;
  }
  


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