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]
Other format: [Raw text]

[Bug c++/10960] GCC Build Problem when Build OpenSP 1.5 with GCC 3.3. Template issue???



------- Comment #4 from bangerth at dealii dot org  2003-05-24 01:42 -------
Not a bug. Your code is roughly equivalent to this:
----------------------------------
template <class T>
struct Ptr {
    ~Ptr()
      {
        if (ptr_) {
          if (ptr_->unref())
            delete ptr_;
          ptr_ = 0;
        }
      }
};

class Resource {
  public:
    void unref ();
};


class AttributeValue;

class AttributeDefinitionDesc {
  public:
    AttributeDefinitionDesc ();
    Ptr<AttributeValue> p;
};

class AttributeValue : public Resource {};
--------------------------------
You are using AttributeValue in AttributeDefinitionDesc before the type is
fully declared. In AttributeDefinitionDesc, you are instantiating 
Ptr<AttributeValue>, which requires knowledge of AttributeValue, which isn't
available yet at that point. You need to reorder your class declarations.

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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