Subject: [Boost-bugs] [Boost C++ Libraries] #6680: Compilation error at regex file basic_regex_parser.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-12 16:39:53
#6680: Compilation error at regex file basic_regex_parser.hpp
----------------------------------+-----------------------------------------
Reporter: miko.nahum@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
Version: Boost 1.49.0 | Severity: Problem
Keywords: |
----------------------------------+-----------------------------------------
Hi,
Compile boost 1.49.0 on Sun SPARC 5.10 using Sun Studio 12 yield
compilation error on file "basic_regex_parser.hpp".
Line 208 of that file contains the following:
message += std::string(m_base + start_pos, m_base + position);
message += ">>>HERE>>>";
message += std::string(m_base + position, m_base + end_pos);
where m_base, poition, start_pos and end_pos defined as:
const charT* m_base;
std::ptrdiff_t position, std::string message, std::ptrdiff_t start_pos
The problem occurs when compile the regex source file "wide_posix_api.cpp"
which indirectly include the file "basic_regex_parser.hpp".
It look like the above code attempts to constructs a nice std::string
error message providing it a small piece of the regex, which in this case
is of wide string type (i.e., construct stdd:string using wchar_t*).
The existent nearest constructor:
basic_string (const _charT*, const _charT*, const _Allocator&
_RWSTD_DEFAULT_ARG(_Allocator()));
where "_charT" is either "char" or "wchar_t", right?!
You can have:
1) basic_string<char>(char* b, char* e)
2) basic_string<wchar_t>(wchar_t* b, wchar_t* e)
But definitively not:
basic_string<char>(wchar_t* b, wchar_t* e)
This is a MISHMASH.
(what error message will be look like if it start as a std::string, than
you concat it piece of wide string, and and end is with a std::string? it
will be garbaged).
Here is the compilation error:
miko_at_compile1-U10-zone[/<5>libs/regex/src] >
miko_at_compile1-U10-zone[/<5>libs/regex/src] > pwd
/VOBS/n2_3rd_party_components/boost/dev/boost_1_49_0/libs/regex/src
miko_at_compile1-U10-zone[/<5>libs/regex/src] >
miko_at_compile1-U10-zone[/<5>libs/regex/src] >
miko_at_compile1-U10-zone[/<5>libs/regex/src] > CC -V
CC: Sun C++ 5.12 SunOS_sparc 2011/11/16
miko_at_compile1-U10-zone[/<5>libs/regex/src] >
miko_at_compile1-U10-zone[/<5>libs/regex/src] >
miko_at_compile1-U10-zone[/<5>libs/regex/src] > CC -c -g -I../../..
wide_posix_api.cpp
"../../../boost/regex/v4/basic_regex_parser.hpp", line 208: Error: Could
not find a match for std::string::basic_string(const wchar_t*, const
wchar_t*) needed in boost::re_detail::basic_regex_parser<wchar_t,
boost::c_regex_traits<wchar_t>>::fail(boost::regex_constants::error_type,
int, std::string, int).
"../../../boost/regex/v4/basic_regex_parser.hpp", line 51: Where:
While instantiating "boost::re_detail::basic_regex_parser<wchar_t,
boost::c_regex_traits<wchar_t>>::fail(boost::regex_constants::error_type,
int, std::string, int)".
"../../../boost/regex/v4/basic_regex_parser.hpp", line 51: Where:
Instantiated from boost::re_detail::basic_regex_parser<wchar_t,
boost::c_regex_traits<wchar_t>>::parse(const wchar_t*, const wchar_t*,
unsigned).
"../../../boost/regex/v4/basic_regex.hpp", line 212: Where:
Instantiated from boost::basic_regex<wchar_t,
boost::c_regex_traits<wchar_t>>::do_assign(const wchar_t*, const wchar_t*,
unsigned).
"../../../boost/regex/v4/basic_regex.hpp", line 379: Where:
Instantiated from non-template code.
"../../../boost/regex/v4/basic_regex_parser.hpp", line 210: Error: Could
not find a match for std::string::basic_string(const wchar_t*, const
wchar_t*) needed in boost::re_detail::basic_regex_parser<wchar_t,
boost::c_regex_traits<wchar_t>>::fail(boost::regex_constants::error_type,
int, std::string, int).
"../../../boost/regex/v4/basic_regex_parser.hpp", line 51: Where:
While instantiating "boost::re_detail::basic_regex_parser<wchar_t,
boost::c_regex_traits<wchar_t>>::fail(boost::regex_constants::error_type,
int, std::string, int)".
"../../../boost/regex/v4/basic_regex_parser.hpp", line 51: Where:
Instantiated from boost::re_detail::basic_regex_parser<wchar_t,
boost::c_regex_traits<wchar_t>>::parse(const wchar_t*, const wchar_t*,
unsigned).
"../../../boost/regex/v4/basic_regex.hpp", line 212: Where:
Instantiated from boost::basic_regex<wchar_t,
boost::c_regex_traits<wchar_t>>::do_assign(const wchar_t*, const wchar_t*,
unsigned).
"../../../boost/regex/v4/basic_regex.hpp", line 379: Where:
Instantiated from non-template code.
2 Error(s) detected.
Exit 2
miko_at_compile1-U10-zone[/<5>libs/regex/src] >
miko_at_compile1-U10-zone[/<5>libs/regex/src] >
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6680> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC