More __comp_ctor () woes

Brendon Costa bcosta@avdat.com.au
Wed Oct 25 04:33:00 GMT 2006


For the code shown below, if i get the type node for the class: 
"MyClassT<int>" and then call TYPE_METHODS() on it and iterate over the 
nodes, there is no FUNCTION_DECL node for the function:

MyClassT<int>::MyClassT<::int, ::char const*>(::char const*)

 From what I understand from the documentation, since this is a member 
function of the class like any other constructor, it should exist. There 
is a TEMPLATE_DECL node however that represents this in the list, but it 
returns NULL_TREE when used with eithre of the macros: 
DECL_TEMPLATE_SPECIALIZATIONS(tmpdecl), or: 
DECL_TEMPLATE_INSTANTIATIONS(tmpdecl). I would expect that it should 
return non-NULL_TREE for DECL_TEMPLATE_SPECIALIZATIONS(tmpdecl)

I know the FUNCTION_DECL node for the function:
MyClassT<int>::MyClassT<::int, ::char const*>(::char const*)

exists as the node passes through the: gimplify.c: 
gimplify_function_tree() method.

Is this a bug or am I doing/expecting something that is incorrect?

Thanks,
Brendon.




template<typename Type>
class MyClassT
{
public:
   template<class _InputIterator>
   MyClassT(_InputIterator __beg) {}
};

typedef MyClassT<int> MyClass;
int main()
{
   const char* str1 = "Hello1";
   MyClass mc(str1);

   return 0;
}




More information about the Gcc mailing list