K
Keith Halligan
I'm switching from the HP-UX compiler aCC 5.55 to aCC 6.13 and I get
the following error:
"templateptr.h", line 20: error #2289: no instance
of constructor "defclass::base::base" matches the
argument list
argument types are: (obj *)
: defclass::base(p)
^
detected during instantiation of
"templateptr<T>::templateptr(T *) [with
T=obj]" at line 50 of
"starter.h"
Since an obj is derived from a defclass, I don't see the problem.
The line I'm using to compile is:
/opt/bin/aCC -o main main.cxx
I'm also getting similar issues on a linux box with GCC 3.4.6 and it
wasn't an issue with 3.2.3.
I was thinking it might be the new two name lookup in the new compiler
but passing +dep_name and +nodep_name switches are making no
difference.
Does anyone have any ideas on it?
-----------------
main.cxx
-----------------
#include <iostream>
#include "starter.h"
int main(void)
{
starter s;
return 0;
}
--------------
starter.h
--------------
#include "templateptr.h"
class obj;
typedef templateptr<obj> obj_ptr;
class starter
{
public:
starter() {}
~starter() {}
obj_ptr p;
};
--------------------
template_ptr.h
--------------------
#include "itrefcounted.h"
template <class T>
class templateptr
: public defclass::base
{
public:
inline templateptr(T* p = 0);
};
template <class T>
inline
templateptr<T>::templateptr(T* p)
: defclass::base(p)
{
}
-------------
defclass.h
-------------
class defclass
{
public:
class base
{
public:
// base (base b);
base (defclass* p = 0);
defclass *m_ref;
};
friend class base;
};
---------------
defclass.cxx
---------------
#include "defclass.h"
itrefcounted::base(defclass *p)
: m_ref(p)
{
}
----------
obj.h
---------
#include "defclass.h"
class obj
: public defclass
{
public:
obj() {}
~obj() {}
};
the following error:
"templateptr.h", line 20: error #2289: no instance
of constructor "defclass::base::base" matches the
argument list
argument types are: (obj *)
: defclass::base(p)
^
detected during instantiation of
"templateptr<T>::templateptr(T *) [with
T=obj]" at line 50 of
"starter.h"
Since an obj is derived from a defclass, I don't see the problem.
The line I'm using to compile is:
/opt/bin/aCC -o main main.cxx
I'm also getting similar issues on a linux box with GCC 3.4.6 and it
wasn't an issue with 3.2.3.
I was thinking it might be the new two name lookup in the new compiler
but passing +dep_name and +nodep_name switches are making no
difference.
Does anyone have any ideas on it?
-----------------
main.cxx
-----------------
#include <iostream>
#include "starter.h"
int main(void)
{
starter s;
return 0;
}
--------------
starter.h
--------------
#include "templateptr.h"
class obj;
typedef templateptr<obj> obj_ptr;
class starter
{
public:
starter() {}
~starter() {}
obj_ptr p;
};
--------------------
template_ptr.h
--------------------
#include "itrefcounted.h"
template <class T>
class templateptr
: public defclass::base
{
public:
inline templateptr(T* p = 0);
};
template <class T>
inline
templateptr<T>::templateptr(T* p)
: defclass::base(p)
{
}
-------------
defclass.h
-------------
class defclass
{
public:
class base
{
public:
// base (base b);
base (defclass* p = 0);
defclass *m_ref;
};
friend class base;
};
---------------
defclass.cxx
---------------
#include "defclass.h"
itrefcounted::base(defclass *p)
: m_ref(p)
{
}
----------
obj.h
---------
#include "defclass.h"
class obj
: public defclass
{
public:
obj() {}
~obj() {}
};