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]

G++ internal compiler error for `struct A { ~A(); }; A::~A(int) {}'


Hi,

Compiling

  struct A
  {
    ~A();
  };
  A::~A(int)
  {
  }


with g++ gives the following message:

  $ c++ -c prune.cc
  prune.cc: In method `A::~A()':
  prune.cc:7: Internal compiler error.
  prune.cc:7: Please submit a full bug report to `egcs-bugs@cygnus.com'.
  $ c++ -v
  Reading specs from .../lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.92.00/specs
  gcc version egcs-2.92.00 19980730 (gcc2 ss-980609 experimental)

A variant

  struct A
  {
    ~A();
  };
  A::~A(int, int)
  {
  }

produces a slightly different message:

  $ c++ -c prune1.cc
  prune1.cc:6: Internal compiler error 892.
				      ^^^^^
  prune1.cc:6: Please submit a full bug report to `egcs-bugs@cygnus.com'.

This message was generated with `my_friendly_abort(892);', not a core
dump.

The fun part is g++ 2.7.2 accepts, and compiles, the above without any
error.

Case 2 was distilled from code in the `word2x' program, found in CTAN
(the Comprehensive TeX Archive Network).  Case 2 was further distilled
to get Case 1.

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash


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