c++/4286

Reichelt reichelt@igpm.rwth-aachen.de
Tue Sep 11 03:28:00 GMT 2001


Hi,

although the original example is ill-formed (the closing brace
of the body of the function "findClusters" is missing) one can
construct a shorter well-formed example that exhibits the same
behaviour (so it's an ice-on-legal):

struct A
{
  template<class T> void f();
};

template<class T> void A::f()
{
  struct B
  {
    void g() {}
    static int x;
  };
}

It crashes gcc 3.0 and the 20010903 snapshot of 3.0.2 on
an i686-pc-linux-gnu and a mips-sgi-irix6.5 system.
Just use "g++ -c" without any further options.

By the way, the bug is a regression from 2.95.3.

Greetings,
Volker Reichelt

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4286&database=gcc




More information about the Gcc-bugs mailing list