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]

Bug Report


Egcs version:           egcs1.1.1
System type:            AIX-4.3.0 and Solaris-2.5.1
Options passed to egcs: g++ -c test.cc
Source file:            see attachment(test.cc)
Output:                 on AIX-4.3.0, see attachment(aix.out)
	                on Solaris-2.5.1 see attachment(sol.out)

#####################
       Betty Li
 ZEH Graphic Systems
(281)759-4265 ext.264
#####################
#define FUNCPTR(x) (&(x))
class MyInterpreter;
class Callback;

class Interpreter
{
public:
    Interpreter()
    {
    }
 
    virtual ~Interpreter()
    {
    }
    virtual int init()=0; 
    virtual void create_command(const int  command_name, Callback* callback) =0;
};

template<class K, class T, int N>
class MyHashTable
{
public:
    class Iterator
    {
    };
public:
    void first(Iterator& pos) const
    {
    }
};
 
class Callback
{
};

template<class OBJECT_TYPE, class INTERPRETER_TYPE>
class Callback_T : public Callback
{
private:
    typedef int (OBJECT_TYPE::*Method)(INTERPRETER_TYPE *interpreter);
private:
    Method _method;
    OBJECT_TYPE* _object;
public:
 
    Callback_T(OBJECT_TYPE* object, Method method)
        : _object(object), _method(method)
    {
    }
 
};
 
template<class INTERPRETER>
class InterpAlias
{
};

class MyInterpreter : public Interpreter
{
private:
    int* _interp;
public:
    MyInterpreter(int* interp) : _interp(interp)
    {
    }
    int init()
    {
    }
    void create_command( const int command_name, Callback* callback)
    {
    }
};
 
template<class INTERP, class INTERPRETER>
class MyNewInterpreter : public INTERPRETER
{
protected:
    MyHashTable<int, InterpAlias<INTERPRETER> *, 17> _aliases;
private:
    void register_commands();
public:
    typedef MyNewInterpreter<INTERP, INTERPRETER> __ThisClass;
    typedef Callback_T<__ThisClass, INTERPRETER> Callback;
    
    MyNewInterpreter(INTERP* interp);
    int init();
    int listAliases(INTERPRETER* interp);
};

template<class INTERP, class INTERPRETER>
inline MyNewInterpreter<INTERP,INTERPRETER>::MyNewInterpreter(INTERP* interp)
    :
    INTERPRETER(interp)
{
}
 
template<class INTERP, class INTERPRETER>
inline void MyNewInterpreter<INTERP,INTERPRETER>::register_commands()
{
    create_command(2, new Callback(this, FUNCPTR(listAliases)));
    return;
}
 
template<class INTERP, class INTERPRETER>
inline int MyNewInterpreter<INTERP,INTERPRETER>::init()
{
    register_commands();
    return(0);
}
 
template<class INTERP, class INTERPRETER>
int MyNewInterpreter<INTERP,INTERPRETER>::listAliases(INTERPRETER* interp)
{
    MyHashTable<int , InterpAlias<INTERPRETER>*, 17>::Iterator it;
    _aliases.first(it);
    return 0;
}


static MyInterpreter *interpreter;
int Tcl_AppInit(int* interp)
{
    interpreter = new MyNewInterpreter<int, MyInterpreter>(interp);
}
test.cc: In method `int MyNewInterpreter<int,MyInterpreter>::listAliases<int, MyInterpreter>(class MyInterpreter *)':
test.cc:100:   instantiated from `MyNewInterpreter<int,MyInterpreter>::register_commands<int, MyInterpreter>()'
test.cc:107:   instantiated from `MyNewInterpreter<int,MyInterpreter>::init<int, MyInterpreter>()'
test.cc:124:   instantiated from here
test.cc:114: Internal compiler error.
test.cc:114: Please submit a full bug report to `egcs-bugs@cygnus.com'.
test.cc:114: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.

test.cc: In method `int MyNewInterpreter<int,MyInterpreter>::listAliases<int, MyInterpreter>(class MyInterpreter *)':
test.cc:100:   instantiated from `MyNewInterpreter<int,MyInterpreter>::register_commands<int, MyInterpreter>()'
test.cc:107:   instantiated from `MyNewInterpreter<int,MyInterpreter>::init<int, MyInterpreter>()'
test.cc:124:   instantiated from here
test.cc:115: no matching function for call to `MyHashTable<int,InterpAlias<MyInterpreter> *,17>::first (MyHashTable<K,T,N>::Iterator &)'
test.cc:28: candidates are: MyHashTable<int,InterpAlias<MyInterpreter> *,17>::first<int, InterpAlias<MyInterpreter> *, 17>(MyHashTable<int,InterpAlias<MyInterpreter> *,17>::Iterator &) const

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