This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/10960] GCC Build Problem when Build OpenSP 1.5 with GCC 3.3. Template issue???
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Oct 2005 01:23:34 -0000
- Subject: [Bug c++/10960] GCC Build Problem when Build OpenSP 1.5 with GCC 3.3. Template issue???
- References: <bug-10960-3095@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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