public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39145] New: g++ -O3 -std=c++0x causes compile error in boost regex
@ 2009-02-10 4:45 john32979 at hotmail dot com
2009-02-27 0:25 ` [Bug c++/39145] " karl dot miller dot km at gmail dot com
2009-10-18 7:01 ` jason at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: john32979 at hotmail dot com @ 2009-02-10 4:45 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7000 bytes --]
Compiling the snippet below using
g++ -O3 -std=c++0x foo.cpp -lboost_regex
fails.
However, the compile succeeds with:
g++ -O2 -std=c++0x foo.cpp -lboost_regex
g++ -O2 -std=c++0x foo.cpp -funswitch-loops -fpredictive-commoning
-fgcse-after-reload -ftree-vectorize foo.cpp -lboost_regex (i.e. -O3 without
-finline-functions)
g++ -O3 foo.cpp -lboost_regex
foo.cpp is below:
#include <iostream>
#include <stdint.h>
#include <boost/regex.hpp>
#include <cstdio>
#include <cstring>
int main(int argc, char**argv) {
const char *first = "abcd";
const char *last = first + strlen(first);
boost::cmatch mr;
boost::regex rx("abc");
boost::regex_constants::match_flag_type fl =
boost::regex_constants::match_default;
std::cout << "search(f, f+1, \"abc\") == " << std::boolalpha
<< regex_search(first, first + 1, rx, fl) << std::endl;
std::cout << "search(f, l, \"abc\") == " << std::boolalpha
<< regex_search(first, last, mr, rx) << std::endl;
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
std::cout << "search(\"a\", \"abc\") == " << std::boolalpha
<< regex_search("a", rx) << std::endl;
std::cout << "search(\"xabcd\", \"abc\") == " << std::boolalpha
<< regex_search("xabcd", mr, rx) << std::endl;
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
std::cout << "search(string, \"abc\") == " << std::boolalpha
<< regex_search(std::string("a"), rx) << std::endl;
std::string str("abcabc");
boost::match_results<std::string::const_iterator> mr2;
std::cout << "search(string, \"abc\") == " << std::boolalpha
<< boost::regex_search(str, mr2, rx) << std::endl;
std::cout << " matched: \"" << mr2.str() << "\"" << std::endl;
return 0;
}
The compile error generated is:
/usr/include/c++/4.3/bits/stl_pair.h: In constructor âstd::pair<_T1,
_T2>::pair(_U1&&, _U2&&) [with _U1 = boost::shared_ptr<const
boost::re_detail::cpp_regex_traits_implementation<char> >&, _U2 = int, _T1 =
boost::shared_ptr<const boost::re_detail::cpp_regex_traits_implementation<char>
>, _T2 = const boost::re_detail::cpp_regex_traits_base<char>*]â:
/usr/include/boost/regex/pending/object_cache.hpp:122: instantiated from
âstatic boost::shared_ptr<const Object> boost::object_cache<Key,
Object>::do_get(const Key&, typename
std::list<std::pair<boost::shared_ptr<const Object>, const Key*>,
std::allocator<std::pair<boost::shared_ptr<const Object>, const Key*> >
>::size_type) [with Key = boost::re_detail::cpp_regex_traits_base<char>, Object
= boost::re_detail::cpp_regex_traits_implementation<char>]â
/usr/include/boost/regex/pending/object_cache.hpp:69: instantiated from
âstatic boost::shared_ptr<const Object> boost::object_cache<Key,
Object>::get(const Key&, typename std::list<std::pair<boost::shared_ptr<const
Object>, const Key*>, std::allocator<std::pair<boost::shared_ptr<const Object>,
const Key*> > >::size_type) [with Key =
boost::re_detail::cpp_regex_traits_base<char>, Object =
boost::re_detail::cpp_regex_traits_implementation<char>]â
/usr/include/boost/regex/v4/cpp_regex_traits.hpp:828: instantiated from
âboost::shared_ptr<const
boost::re_detail::cpp_regex_traits_implementation<charT> >
boost::re_detail::create_cpp_regex_traits(const std::locale&) [with charT =
char]â
/usr/include/boost/regex/v4/cpp_regex_traits.hpp:848: instantiated from
âboost::cpp_regex_traits<charT>::cpp_regex_traits() [with charT = char]â
/usr/include/boost/regex/v4/regex_traits.hpp:75: instantiated from
âboost::regex_traits<charT, implementationT>::regex_traits() [with charT =
char, implementationT = boost::cpp_regex_traits<char>]â
/usr/include/boost/regex/v4/regex_traits.hpp:169: instantiated from
âboost::regex_traits_wrapper<BaseT>::regex_traits_wrapper() [with BaseT =
boost::regex_traits<char, boost::cpp_regex_traits<char> >]â
/usr/include/boost/regex/v4/basic_regex.hpp:61: instantiated from
âboost::re_detail::regex_data<charT, traits>::regex_data() [with charT =
char, traits = boost::regex_traits<char, boost::cpp_regex_traits<char> >]â
/usr/include/boost/regex/v4/basic_regex.hpp:93: instantiated from
âboost::re_detail::basic_regex_implementation<charT,
traits>::basic_regex_implementation() [with charT = char, traits =
boost::regex_traits<char, boost::cpp_regex_traits<char> >]â
/usr/include/boost/regex/v4/basic_regex.hpp:525: instantiated from
âboost::basic_regex<charT, traits>& boost::basic_regex<charT,
traits>::do_assign(const charT*, const charT*,
boost::regex_constants::syntax_option_type) [with charT = char, traits =
boost::regex_traits<char, boost::cpp_regex_traits<char> >]â
/usr/include/boost/regex/v4/basic_regex.hpp:262: instantiated from
âboost::basic_regex<charT, traits>& boost::basic_regex<charT,
traits>::assign(const charT*, const charT*,
boost::regex_constants::syntax_option_type) [with charT = char, traits =
boost::regex_traits<char, boost::cpp_regex_traits<char> >]â
/usr/include/boost/regex/v4/basic_regex.hpp:247: instantiated from
âboost::basic_regex<charT, traits>& boost::basic_regex<charT,
traits>::assign(const charT*, boost::regex_constants::syntax_option_type) [with
charT = char, traits = boost::regex_traits<char, boost::cpp_regex_traits<char>
>]â
/usr/include/boost/regex/v4/basic_regex.hpp:216: instantiated from
âboost::basic_regex<charT, traits>::basic_regex(const charT*,
boost::regex_constants::syntax_option_type) [with charT = char, traits =
boost::regex_traits<char, boost::cpp_regex_traits<char> >]â
foo.cpp:11: instantiated from here
/usr/include/c++/4.3/bits/stl_pair.h:95: error: invalid conversion from
âintâ to âconst boost::re_detail::cpp_regex_traits_base<char>*â
gcc -v is:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)
--
Summary: g++ -O3 -std=c++0x causes compile error in boost regex
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: john32979 at hotmail dot com
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39145
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/39145] g++ -O3 -std=c++0x causes compile error in boost regex
2009-02-10 4:45 [Bug c++/39145] New: g++ -O3 -std=c++0x causes compile error in boost regex john32979 at hotmail dot com
@ 2009-02-27 0:25 ` karl dot miller dot km at gmail dot com
2009-10-18 7:01 ` jason at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: karl dot miller dot km at gmail dot com @ 2009-02-27 0:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from karl dot miller dot km at gmail dot com 2009-02-27 00:25 -------
The same code and cmd line arguments compile without problems for me.
$ gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3
--enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap
--with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.3
--enable-linux-futex --without-system-libunwind --with-cpu=generic
--build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39145
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/39145] g++ -O3 -std=c++0x causes compile error in boost regex
2009-02-10 4:45 [Bug c++/39145] New: g++ -O3 -std=c++0x causes compile error in boost regex john32979 at hotmail dot com
2009-02-27 0:25 ` [Bug c++/39145] " karl dot miller dot km at gmail dot com
@ 2009-10-18 7:01 ` jason at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-10-18 7:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jason at gcc dot gnu dot org 2009-10-18 07:01 -------
I can't reproduce this with 4.4 or 4.5, either.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |WORKSFORME
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39145
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-18 7:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-10 4:45 [Bug c++/39145] New: g++ -O3 -std=c++0x causes compile error in boost regex john32979 at hotmail dot com
2009-02-27 0:25 ` [Bug c++/39145] " karl dot miller dot km at gmail dot com
2009-10-18 7:01 ` jason at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).