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: slice valarrays with std::string -> segfault


Paolo Carlini wrote:

>I think something is going wrong with types characterized by
>""non-trivial"" constructors, e.g., doing memory allocation from the heap.
>
>Gaby can you look into this?
>  
>
Gaby, I see __valarray_copy used (instead of __valarray_copy_construct)
by the conversion constructor from slice_array for any type T: i.e., no
placement new, that cannot possibly work a T such as 'struct element' in
the posted snippet. Indeed, lots and lots of errors from valgrind...

Maybe there is something I'm missing in the Specs of valarray for the
conversion constructors?

Paolo.


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