🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1081

g++ fatal error

#1081
From: Tracey Beauchat
Date: Thu, 05 Nov 1992 09:52
73 lines
2974 bytes
The follow code (well, plus more method definitions, etc) causes
a fatal compiler error and dumps core:

tracey@il> g++ -c new.c
cp-decl.c:9961: failed assertion `current_class_decl != NULL_TREE && TREE_CODE (current_class_decl) == PARM_DECL'
/usr/local/gnu/bin/gcc: Internal compiler error: program cc1plus got fatal signal 6
tracey@il>

The problem is that the "element" method is defined twice, once
inline.  I imagine this error should be caught, and the compiler
should not crash.  I have not included all of the source code since
the cause of the problem is known.

-Tracey

-------------------------------------------------------------------
                        Tracey A. Beauchat
-------------------------------------------------------------------
*********   *********   ********
*********   ***   ***   ***   ***    The College of William & Mary
   ***      *********   ********     Department of Computer Science
   ***      ***   ***   ***   ***    Williamsburg, VA  23185
   ***      ***   ***   ********
-------------------------------------------------------------------
       EMAIL: tracey@cs.wm.edu         PHONE: (804)221-3468
-------------------------------------------------------------------
         <-[ " The truth is a virus! " - Harry Hardon ]->


----------------------- CUT HERE --------------------------

--- SOME INCLUDES, ETC ---

template <class dtype>
class matrix
 {
  dtype ** p;
  int s1, s2;
 public:
  int ub1, ub2;
  matrix(matrix &);
  matrix(dtype, int, int);
  matrix(int, int, ...);
  matrix(const char, int, int, float);	// Create a rotation matrix, 'r' for
					// radians, 'd' for degrees
  ~matrix();
  dtype& element(int i, int j); {return p[i][j];}// Return a certain element
  void mmpy(matrix& a, matrix& b);
  friend ostream& operator << (ostream&, matrix&);	// Output a matrix
  friend istream& operator >> (istream&, matrix&);	// Input a matrix
  void fill(dtype);
  matrix& operator=(matrix&);		// Assignment operator for matrix
  matrix& operator!();		        // Transpose operator for matrix
  matrix  operator*(matrix&);		// Matrix multiplication
  matrix& operator+(matrix&);		// Matrix addition
  matrix& operator-(matrix&);		// Matrix subtraction
 };


--- SOME METHOD DEFINITIONS ---


 template <class dtype>
 dtype& matrix<dtype>::element(int i, int j)
  {
   if (i < 0 || i > ub1 || j < 0 || j > ub2)
    matrixquit(2);

   return(p[i][j]);
  }


--- MORE METHOD DEFINITIONS ---
Technical Details
Message-ID: <9211051952.AA14684@il.cs.wm.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.wm.edu!tracey

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.wm.edu!tracey
From: tracey@cs.wm.edu (Tracey Beauchat)
Subject: g++ fatal error
Message-ID: <9211051952.AA14684@il.cs.wm.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 5 Nov 1992 09:52:44 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 75