// compile this with -O3 to get segfault on 4.0.3,
// note the "warning: inline function 'A::~A()' used but never defined".
// 3.3 and 4.1 accept this code without warning.
// This bug was originally reported by Alexey Maximov <[EMAIL PROTECTED]>

struct A;

template<class T>
struct P
{
  P() : p(0) { }
  ~P();
  T *p;
};

template<class T>
P<T>::~P()
{
  delete p;
}

struct Q : private P<A>
{
};

struct V
{
  virtual ~V();
};

#pragma interface

struct A
{
  V d;
  Q p;
};

struct T
{
  T ();
  Q q;
};

T::T ()
{
}


-- 
           Summary: [4.0 regression] Segmentation fault (infinite recursion
                    in cgraph_clone_inlined_nodes)
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: belyshev at depni dot sinp dot msu dot ru


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24852

Reply via email to