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]

Re: More __comp_ctor () woes


On Tue, 2006-10-24 at 02:30 +0000, Brendon Costa wrote:
> I am trying to find the corresponding constructor from the basic_string 
> class that should be called in place of the __comp_ctor function. There 
> seems to be no FUNCTION_DECL node for the constructor: 
> 
> basic_string(::char const*, ::char const*, ::std::allocator<char> const&)
> 
> which I would expect if there is a __comp_ctor () with those parameters.

Wait you say you have a function decl but cannot find the function decl
for the constructor?  I don't understand what you are getting at here.
Do you understand how templates work because that seems like where you
are getting lost.  Templates are instantiated with different types, in
this case, with _InputIterator being "const char*"

> My questions are:
> 
> 1) Which of the basic_string constructors would be being called in this 
> situation?


template<class _InputIterator>
basic_string(_InputIterator, _InputIterator, const _Alloc& );

Instantiated with _InputIterator being "const char*".

> 3) Again, is there a simple way of finding the constructor method that 
> would be called given a corresponding __comp_ctor () method?

Find how and what? Find the FUNCTION_DECL? (you should already have
that.)  Find the body of the function? (function decl has that.) Find
where the function is defined in the source? (the lotus of the function
decl should say where that is).


Thanks,
Andrew Pinski



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