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]

Infinite compilation!


Dear GCC developers,

the attached file can not be compiled under gcc-2.95.2. Compilation time
and memory consumption are infinite.

// gcc-2.95.2 will compile this code
// if you comments any marked line(s).
class A
{
  public:
    virtual A *f(int n) {}              // Comment this!
};

template <int N,class T>
class B : public A
{
  public:
    A *f(int n) {return new B<N-1,T>;}  // Comment this!
};

main(void)
{
  B<5,int> b;                           // Comment this!
}

// End of file //


With best wishes,
Alexander Zvyagin.


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