Opened 13 years ago

Closed 13 years ago

#3712 closed Bugs (fixed)

Bug in xpressive

Reported by: pabloh@… Owned by: Eric Niebler
Milestone: Boost 1.42.0 Component: xpressive
Version: Boost 1.41.0 Severity: Showstopper
Keywords: Cc:

Description

Hello,

I used to had an old version of boost (I don't remember exactly which) and my code worked fine. Now I updated to the last version and I started to receive compilation errors in linux when using a std::vector with regular expressions from boost::xpressive, in windows it compiles fine. This code doesn't compile:

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

typedef boost::xpressive::basic_regex<std::string::const_iterator> regex_t;

int main(int argc, char* argv[]) {

std::vector<regex_t> vector; vect.push_back(regex_t());

return 0;

}

Compiler output:

cd '/home/segurmatica/console_filter/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" LC_MESSAGES="C" LC_CTYPE="C" gmake -k gmake all-recursive Making all in src compiling console_filter.cpp (g++) In file included from /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/vector:63, from /home/segurmatica/console_filter/src/console_filter.cpp:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/bits/stl_construct.h: In static member function 'static void std::_Destroy_aux<<anonymous> >::destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = boost::xpressive::basic_regex<gnu_cxx::normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*, bool <anonymous> = false]': /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/bits/stl_construct.h:116: instantiated from 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = boost::xpressive::basic_regex<gnu_cxx::normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*]' /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/bits/stl_construct.h:142: instantiated from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = boost::xpressive::basic_regex<gnu_cxx::normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*, _Tp = boost::xpressive::basic_regex<gnu_cxx::normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >]' /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/bits/stl_vector.h:313: instantiated from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = boost::xpressive::basic_regex<gnu_cxx::normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, _Alloc = std::allocator<boost::xpressive::basic_regex<__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >]' /home/segurmatica/console_filter/src/console_filter.cpp:8: instantiated from here /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/bits/stl_construct.h:93: 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>)' gmake[2]: * [console_filter.o] Error 1 gmake[2]: Target `all' not remade because of errors. gmake[2]: Nothing to be done for `all-am'. gmake[1]: * [all-recursive] Error 1 gmake: * [all] Error 2 * Exited with status: 2 *

I'm using gcc 4.4.2 and boost 1.41

Change History (2)

comment:1 by Eric Niebler, 13 years ago

(In [58281]) disable proto's unary operator& for basic_regex objects, references #3712

comment:2 by Eric Niebler, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.