std::vector<boost::xpressive::sregex> fails to compile using gcc

Discussion in 'C++' started by flewpaul@gmail.com, Jan 21, 2010.

  1. Guest

    Hi

    I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
    compiles my code successfully, but gcc 3.4 and 4.1 fail with:

    <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
    std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
    [with _ForwardIterator = boost::xpressive::sregex*]':
    <path>/include/c++/3.4.5/bits/stl_construct.h:152: instantiated from
    `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
    _ForwardIterator = boost::xpressive::sregex*]'
    <path>/include/c++/3.4.5/bits/stl_vector.h:256: instantiated from
    `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
    boost::xpressive::sregex, _Alloc =
    std::allocator<boost::xpressive::sregex>]'
    ...\test.cpp:9: instantiated from here
    <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
    function for call to `_Destroy(const
    boost::proto::exprns_::expr<boost::proto::tag::address_of,
    boost::proto::argsns_::list1<boost::xpressive::basic_regex<__gnu_cxx::__normal_iterator<const
    char*, std::basic_string<char, std::char_traits<char>,
    std::allocator<char> > > >&>, 1l>)'

    The code to generate this is:

    #include <vector>
    #include <boost/xpressive/xpressive_dynamic.hpp>

    using namespace std;
    using namespace boost::xpressive;

    int main(int argc, char* argv[])
    {
    vector<sregex> vec;
    return 0;
    }

    Appreciate any feedback on solving this problem.

    Rgds


    Paul Flew
     
    , Jan 21, 2010
    #1
    1. Advertising

  2. Rene Gill Guest

    Should it not be g++ the compiler?
     
    Rene Gill, Jan 22, 2010
    #2
    1. Advertising

  3. On Jan 22, 10:00 am, Rene Gill <> wrote:
    > Should it not be g++ the compiler?


    Mr Gill, I don't think so
     
    **Group User**, Jan 22, 2010
    #3
  4. I confirm the issue. By replacing the vector by a list, the example
    compiles fine. I suggest you to ask your question directly on the
    boost-users mailing list.

    A priori, it seems to be a compiler bug.

    Christophe
     
    Christophe Bourez, Jan 22, 2010
    #4
  5. Jeff Flinn Guest

    Re: std::vector<boost::xpressive::sregex> fails to compile usinggcc

    wrote:
    > Hi
    >
    > I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
    > compiles my code successfully, but gcc 3.4 and 4.1 fail with:
    >
    > <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
    > std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
    > [with _ForwardIterator = boost::xpressive::sregex*]':
    > <path>/include/c++/3.4.5/bits/stl_construct.h:152: instantiated from
    > `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
    > _ForwardIterator = boost::xpressive::sregex*]'
    > <path>/include/c++/3.4.5/bits/stl_vector.h:256: instantiated from
    > `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
    > boost::xpressive::sregex, _Alloc =
    > std::allocator<boost::xpressive::sregex>]'
    > ..\test.cpp:9: instantiated from here
    > <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
    > function for call to `_Destroy(const
    > boost::proto::exprns_::expr<boost::proto::tag::address_of,
    > boost::proto::argsns_::list1<boost::xpressive::basic_regex<__gnu_cxx::__normal_iterator<const
    > char*, std::basic_string<char, std::char_traits<char>,
    > std::allocator<char> > > >&>, 1l>)'
    >
    > The code to generate this is:
    >
    > #include <vector>
    > #include <boost/xpressive/xpressive_dynamic.hpp>
    >
    > using namespace std;
    > using namespace boost::xpressive;
    >
    > int main(int argc, char* argv[])
    > {
    > vector<sregex> vec;
    > return 0;
    > }


    My guess is that sregex is an incomplete type in this context, and IIRC,
    std::vector requires complete type for instantiation. Did you mean to
    include xpressive_dynamic.hpp? sregex probably is only forward declared
    with this include. Did you mean to include xpressive_static.hpp?

    Jeff
     
    Jeff Flinn, Jan 22, 2010
    #5
  6. On 22 jan, 14:38, Jeff Flinn <> wrote:
    > wrote:
    > > Hi

    >
    > > I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
    > > compiles my code successfully, but gcc 3.4 and 4.1 fail with:

    >
    > > <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
    > > std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
    > > [with _ForwardIterator = boost::xpressive::sregex*]':
    > > <path>/include/c++/3.4.5/bits/stl_construct.h:152:   instantiated from
    > > `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
    > > _ForwardIterator = boost::xpressive::sregex*]'
    > > <path>/include/c++/3.4.5/bits/stl_vector.h:256:   instantiated from
    > > `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
    > > boost::xpressive::sregex, _Alloc =
    > > std::allocator<boost::xpressive::sregex>]'
    > > ..\test.cpp:9:   instantiated from here
    > > <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
    > > function for call to `_Destroy(const
    > > boost::proto::exprns_::expr<boost::proto::tag::address_of,
    > > boost::proto::argsns_::list1<boost::xpressive::basic_regex<__gnu_cxx::__normal_iterator<const
    > > char*, std::basic_string<char, std::char_traits<char>,
    > > std::allocator<char> > > >&>, 1l>)'

    >
    > > The code to generate this is:

    >
    > > #include <vector>
    > > #include <boost/xpressive/xpressive_dynamic.hpp>

    >
    > > using namespace std;
    > > using namespace boost::xpressive;

    >
    > > int main(int argc, char* argv[])
    > > {
    > >        vector<sregex> vec;
    > >        return 0;
    > > }

    >
    > My guess is that sregex is an incomplete type in this context, and IIRC,
    > std::vector requires complete type for instantiation. Did you mean to
    > include xpressive_dynamic.hpp? sregex probably is only forward declared
    > with this include. Did you mean to include xpressive_static.hpp?
    >
    > Jeff


    Hi Jeff,

    In my test, I did
    #include <boost/xpressive/xpressive.hpp> which includes both dynamic
    and static.

    Christophe
     
    Christophe Bourez, Jan 22, 2010
    #6
  7. Guest

    On Jan 22, 5:41 am, Christophe Bourez <> wrote:
    > On 22 jan, 14:38, Jeff Flinn <> wrote:
    >
    >
    >
    > > wrote:
    > > > Hi

    >
    > > > I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
    > > > compiles my code successfully, but gcc 3.4 and 4.1 fail with:

    >
    > > > <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
    > > > std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
    > > > [with _ForwardIterator = boost::xpressive::sregex*]':
    > > > <path>/include/c++/3.4.5/bits/stl_construct.h:152:   instantiated from
    > > > `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
    > > > _ForwardIterator = boost::xpressive::sregex*]'
    > > > <path>/include/c++/3.4.5/bits/stl_vector.h:256:   instantiated from
    > > > `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
    > > > boost::xpressive::sregex, _Alloc =
    > > > std::allocator<boost::xpressive::sregex>]'
    > > > ..\test.cpp:9:   instantiated from here
    > > > <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
    > > > function for call to `_Destroy(const
    > > > boost::proto::exprns_::expr<boost::proto::tag::address_of,
    > > > boost::proto::argsns_::list1<boost::xpressive::basic_regex<__gnu_cxx::__normal_iterator<const
    > > > char*, std::basic_string<char, std::char_traits<char>,
    > > > std::allocator<char> > > >&>, 1l>)'

    >
    > > > The code to generate this is:

    >
    > > > #include <vector>
    > > > #include <boost/xpressive/xpressive_dynamic.hpp>

    >
    > > > using namespace std;
    > > > using namespace boost::xpressive;

    >
    > > > int main(int argc, char* argv[])
    > > > {
    > > >        vector<sregex> vec;
    > > >        return 0;
    > > > }

    >
    > > My guess is that sregex is an incomplete type in this context, and IIRC,
    > > std::vector requires complete type for instantiation. Did you mean to
    > > include xpressive_dynamic.hpp? sregex probably is only forward declared
    > > with this include. Did you mean to include xpressive_static.hpp?

    >
    > > Jeff

    >
    > Hi Jeff,
    >
    > In my test, I did
    > #include <boost/xpressive/xpressive.hpp> which includes both dynamic
    > and static.
    >
    > Christophe


    Thanks for the responses. I'll look at my code to see whether a list<>
    will offer the performance I need in this case. I did cross-post to
    gnu.g++.bug but haven't got any response - I'll post on the Boost list
    aswell.

    Many Thanks



    Paul
     
    , Jan 22, 2010
    #7
  8. Guest

    On Jan 22, 9:19 am, "" <> wrote:
    > On Jan 22, 5:41 am, Christophe Bourez <> wrote:
    >
    >
    >
    > > On 22 jan, 14:38, Jeff Flinn <> wrote:

    >
    > > > wrote:
    > > > > Hi

    >
    > > > > I'm trying to use a vector of Boost Xpressive sregex objects. VS2005
    > > > > compiles my code successfully, but gcc 3.4 and 4.1 fail with:

    >
    > > > > <path>/include/c++/3.4.5/bits/stl_construct.h: In function `void
    > > > > std::__destroy_aux(_ForwardIterator, _ForwardIterator, __false_type)
    > > > > [with _ForwardIterator = boost::xpressive::sregex*]':
    > > > > <path>/include/c++/3.4.5/bits/stl_construct.h:152:   instantiated from
    > > > > `void std::_Destroy(_ForwardIterator, _ForwardIterator) [with
    > > > > _ForwardIterator = boost::xpressive::sregex*]'
    > > > > <path>/include/c++/3.4.5/bits/stl_vector.h:256:   instantiated from
    > > > > `std::vector<_Tp, _Alloc>::~vector() [with _Tp =
    > > > > boost::xpressive::sregex, _Alloc =
    > > > > std::allocator<boost::xpressive::sregex>]'
    > > > > ..\test.cpp:9:   instantiated from here
    > > > > <path>/include/c++/3.4.5/bits/stl_construct.h:120: error: no matching
    > > > > function for call to `_Destroy(const
    > > > > boost::proto::exprns_::expr<boost::proto::tag::address_of,
    > > > > boost::proto::argsns_::list1<boost::xpressive::basic_regex<__gnu_cxx::__normal_iterator<const
    > > > > char*, std::basic_string<char, std::char_traits<char>,
    > > > > std::allocator<char> > > >&>, 1l>)'

    >
    > > > > The code to generate this is:

    >
    > > > > #include <vector>
    > > > > #include <boost/xpressive/xpressive_dynamic.hpp>

    >
    > > > > using namespace std;
    > > > > using namespace boost::xpressive;

    >
    > > > > int main(int argc, char* argv[])
    > > > > {
    > > > >        vector<sregex> vec;
    > > > >        return 0;
    > > > > }

    >
    > > > My guess is that sregex is an incomplete type in this context, and IIRC,
    > > > std::vector requires complete type for instantiation. Did you mean to
    > > > include xpressive_dynamic.hpp? sregex probably is only forward declared
    > > > with this include. Did you mean to include xpressive_static.hpp?

    >
    > > > Jeff

    >
    > > Hi Jeff,

    >
    > > In my test, I did
    > > #include <boost/xpressive/xpressive.hpp> which includes both dynamic
    > > and static.

    >
    > > Christophe

    >
    > Thanks for the responses. I'll look at my code to see whether a list<>
    > will offer the performance I need in this case. I did cross-post to
    > gnu.g++.bug but haven't got any response - I'll post on the Boost list
    > aswell.
    >
    > Many Thanks
    >
    > Paul


    Posted on Boost bug list, turns out it has already been reported and
    fixed for Boost 1.42 (https://svn.boost.org/trac/boost/ticket/3712)
     
    , Jan 25, 2010
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Heyes
    Replies:
    8
    Views:
    755
    Andrew Koenig
    Jan 15, 2006
  2. Eric Niebler
    Replies:
    2
    Views:
    500
    Phlip
    Mar 17, 2006
  3. Barry
    Replies:
    1
    Views:
    478
    Eric Niebler
    Jul 11, 2007
  4. Eric Niebler
    Replies:
    0
    Views:
    646
    Eric Niebler
    Oct 24, 2007
  5. Joost Kraaijeveld
    Replies:
    7
    Views:
    1,452
    Triple-DES
    Jan 5, 2009
Loading...

Share This Page