This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: GCC 3.4 parser bug?


Craig Rodrigues wrote:

Is this ill-formed code, or a parser bug?

Seems to me a parser bug (-> PR!).

Not being a language lawyer, I'm convinced by the evidence
that in the further reduced testcase below the error goes
away (!) if I get rid of the typedef (see commented out code)

Paolo.

/////////
template <class X, class ACE_LOCK> class ACE_Refcounted_Auto_Ptr_Rep;

template <class X, class ACE_LOCK>
class ACE_Refcounted_Auto_Ptr
{
public:
  virtual ~ACE_Refcounted_Auto_Ptr (void);

protected:
  typedef ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> AUTO_REFCOUNTED_PTR_REP;
  AUTO_REFCOUNTED_PTR_REP *rep_;
  // ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> *rep_;
};

template <class X, class ACE_LOCK>
class ACE_Refcounted_Auto_Ptr_Rep
{
private:
  friend class ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>;

  static void detach (ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> *&rep);
  ACE_LOCK lock_;
};

template <class X, class ACE_LOCK> inline
ACE_Refcounted_Auto_Ptr<X, ACE_LOCK>::~ACE_Refcounted_Auto_Ptr (void)
{
  AUTO_REFCOUNTED_PTR_REP::detach (rep_);
  // ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::detach (rep_);
}

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