This is the mail archive of the gcc@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]
Other format: [Raw text]

__comp_ctor and std::ofstream default constructor


Hi all,

I am having trouble with finding what method of a class that __comp_ctor () would call. I have been assuming that it will call the constructor method that has the same parameter list as the __comp_ctor () function but this does not seem to be working.

Particulary when compiling code that uses std::ofstream. At some point the std::basic_ofstream<char,std::char_traits<char> >::__comp_ctor () function is being called, and I am trying to find the FUNCTION_DECL node for the assocated std::basic_ofstream<char,std::char_traits<char> >::basic_ofstream () constructor method.

This seems to be a problem. I can see the method in the fstream source header file, but the FUNCTION_DECL node for the constructor has strange arguments which do not seem to be in the source file.

In particular calling: DECL_ARGUMENTS() on the function decl and iterating over its parameters i get the following parameters for what i think is the default constructor for the basic_ofstream class.

(I EXPECT THIS ARGUMENT AND NO OTHERS)
arg: 0
   name: this
   type: NULL

(I DONT EXPECT THE FOLLOWIN ARGS)
arg: 1
   name: __in_chrg
   type: int

arg: 2
   name: __vtt_parm
   type: NULL


So somehow the code: basic_ofstream::basic_ofstream()

is producing a FUNCTION_DECL with args that suggest it is declared:
basic_ofstream::basic_ofstream(int __in_chrg, void* __vtt_parm)

Can someone please help me understand why this happens?

Also when given a FUNCTION_DECL node for a __comp_ctor () function of a class, how I can find the FUNCTION_DECL node that would be called by it in order to perform the initialisation of the class data?

Thanks,
Brendon.


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