cint bug(?): typedef in custom cast operator signature

View: New views
2 Messages — Rating Filter:   Alert me  

cint bug(?): typedef in custom cast operator signature

by Zelzer Sascha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am trying to generate dictionary information for some classes in our
toolkit. We rely heavily on a (templated) smart pointer implementation
which declares a custom cast operator using a typedef. Unfortunately,
the code generated by cint/makecint does not compile. Using the original
typename works. Here is a reduced testcase:

// ====== begin custom cast operator test ======
template<typename T>
class SmartPointer
{

 public:

  typedef T ObjectType;

  SmartPointer() : m_Pointer(0) {}
  SmartPointer(ObjectType* p) : m_Pointer(p) {}

  /** Return pointer to object.  */
  operator ObjectType * () const
  //operator T * () const // this works!
    { return m_Pointer; }

 private:

  ObjectType* m_Pointer;
};

class Dummy
{
};

SmartPointer<Dummy> sp;
// ====== end custom cast operator test ======

Typing

makecint -mk Makefile -dl cco -H custom_cast_operator.cpp
make

fails with svn revision 27119 and gcc 4.1.2. Is this a limitation or a
bug?

Regards,
Sascha


Re: cint bug(?): typedef in custom cast operator signature

by Axel Naumann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Sascha!

Thanks for the report! I will check during the second half of the week,
and I agree that this seems to be a name lookup issue.

Cheers, Axel.


On 2009-01-18 14:37, Zelzer Sascha wrote:

> Hi,
>
> I am trying to generate dictionary information for some classes in our
> toolkit. We rely heavily on a (templated) smart pointer implementation
> which declares a custom cast operator using a typedef. Unfortunately,
> the code generated by cint/makecint does not compile. Using the original
> typename works. Here is a reduced testcase:
>
> // ====== begin custom cast operator test ======
> template<typename T>
> class SmartPointer
> {
>
>  public:
>
>   typedef T ObjectType;
>
>   SmartPointer() : m_Pointer(0) {}
>   SmartPointer(ObjectType* p) : m_Pointer(p) {}
>
>   /** Return pointer to object.  */
>   operator ObjectType * () const
>   //operator T * () const // this works!
>     { return m_Pointer; }
>
>  private:
>
>   ObjectType* m_Pointer;
> };
>
> class Dummy
> {
> };
>
> SmartPointer<Dummy> sp;
> // ====== end custom cast operator test ======
>
> Typing
>
> makecint -mk Makefile -dl cco -H custom_cast_operator.cpp
> make
>
> fails with svn revision 27119 and gcc 4.1.2. Is this a limitation or a
> bug?
>
> Regards,
> Sascha
>
>