g++ 2.95.2 "Internal Compiler Bug"

Lance A. Page lpage@draper.com
Fri Dec 17 08:22:00 GMT 1999


Hello,
I am encountering an Internal Compiler Bug.

BTW, this should compile cleanly, shouldn't it

HERE IS THE COMMAND-LINE OUTPUT, INDICATING SYSTEM TYPE AND G++ VERSION....
----------------------------------------------------------------------------

$ g++ -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
$ 
$ uname -a
Linux lap1593.draper.com 2.2.5-22 #1 Wed Jun 2 09:17:03 EDT 1999 i686 unknown
$ 
$ g++ -c anglebug.cc
anglebug.cc:21: Internal compiler error.
anglebug.cc:21: Please submit a full bug report.
anglebug.cc:21: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for
instructions.
$ 
$ 


HERE IS THE CODE THAT EXERCISES THAT BUG:
-----------------------------------------
// anglebug.cc
// This file causes an Internal Compiler Error in:
//   gcc version 2.95.2 19991024 (release)
//
// The error goes away, if the AngleDegrees ctor is placed inside the 
// AngleDegrees class definition.

class Angle {
 private:
  double d_value;
 protected:
  class Private {};
  Angle(Private p, double rad) : d_value(rad) {} 
};

class AngleDegrees : public Angle {
 public:
  AngleDegrees(double a);
};

class AngleDegrees::AngleDegrees(double a)
  : Angle(Private(), a) {}


More information about the Gcc-bugs mailing list