[LLVMbugs] [Bug 21196] New: Clang svn r219085 fails to compile regex program using libstdc++ in C++1y, C++14, C++1z
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Oct 7 15:16:40 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=21196
Bug ID: 21196
Summary: Clang svn r219085 fails to compile regex program using
libstdc++ in C++1y, C++14, C++1z
Product: new-bugs
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: remyabel at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 13163
--> http://llvm.org/bugs/attachment.cgi?id=13163&action=edit
The test program which uses regex
For more information, see
https://stackoverflow.com/questions/26245167/compiling-regex-program-in-clang-for-libstdc-in-c14-mode-causes-errors
The libstdc++ binary is libstdc++.so.6.0.20
The following test program works fine with the following command lines for the
attached test program (using gcc 4.9.1):
g++4.9 -std=c++11 test.cpp
g++4.9 -std=c++1y test.cpp
g++4.9 -std=c++14 test.cpp
clang++ -stdlib=libstdc++ -std=c++11 test.cpp
clang++ -stdlib=libc++ -std=c++11 test.cpp
clang++ -stdlib=libc++ -std=c++1y test.cpp
clang++ -stdlib=libc++ -std=c++14 test.cpp
clang++ -stdlib=libc++ -std=c++1z test.cpp
When using the following command lines:
clang++ -stdlib=libstdc++ -std=c++1y test.cpp
clang++ -stdlib=libstdc++ -std=c++14 test.cpp
clang++ -stdlib=libstdc++ -std=c++1y test.cpp
it fails to compile with the following errors:
In file included from main.cpp:4:
In file included from
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/regex:58:
In file included from
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/regex.h:2721:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/regex.tcc:632:11:
error: member function '_M_end_of_seq' not viable: 'this' argument has type
'const std::regex_token_iterator<__gnu_cxx::__normal_iterator<const char *,
std::basic_string<char> >, char, std::regex_traits<char> >', but function is
not marked const
if (_M_end_of_seq() && __rhs._M_end_of_seq())
^~~~~~~~~~~~~
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/regex.h:2641:24:
note: in instantiation of member function
'std::regex_token_iterator<__gnu_cxx::__normal_iterator<const char *,
std::basic_string<char> >, char, std::regex_traits<char> >::operator=='
requested here
{ return !(*this == __rhs); }
^
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/stl_algobase.h:305:19:
note: in instantiation of member function
'std::regex_token_iterator<__gnu_cxx::__normal_iterator<const char *,
std::basic_string<char> >, char, std::regex_traits<char> >::operator!='
requested here
for (; __first != __last; ++__result, ++__first)
^
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/stl_algobase.h:396:36:
note: in instantiation of function template specialization
'std::__copy_move<false, false,
std::forward_iterator_tag>::__copy_m<std::regex_token_iterator<__gnu_cxx::__normal_iterator<const
char *, std::basic_string<char> >, char, std::regex_traits<char> >,
std::ostream_iterator<std::basic_string<char>, char, std::char_traits<char> >
>' requested here
_Category>::__copy_m(__first, __last,
__result);
^
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/stl_algobase.h:432:23:
note: in instantiation of function template specialization
'std::__copy_move_a<false,
std::regex_token_iterator<__gnu_cxx::__normal_iterator<const char *,
std::basic_string<char> >, char, std::regex_traits<char> >,
std::ostream_iterator<std::basic_string<char>, char, std::char_traits<char> >
>' requested here
return _OI(std::__copy_move_a<_IsMove>(std::__niter_base(__first),
^
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/stl_algobase.h:464:20:
note: in instantiation of function template specialization
'std::__copy_move_a2<false,
std::regex_token_iterator<__gnu_cxx::__normal_iterator<const char *,
std::basic_string<char> >, char, std::regex_traits<char> >,
std::ostream_iterator<std::basic_string<char>, char, std::char_traits<char> >
>' requested here
return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
^
main.cpp:13:9: note: in instantiation of function template specialization
'std::copy<std::regex_token_iterator<__gnu_cxx::__normal_iterator<const char *,
std::basic_string<char> >, char, std::regex_traits<char> >,
std::ostream_iterator<std::basic_string<char>, char, std::char_traits<char> >
>' requested here
std::copy( std::sregex_token_iterator(text.begin(), text.end(), ws_re,
-1),
^
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/regex.h:2690:7:
note: '_M_end_of_seq' declared here
_M_end_of_seq()
^
In file included from main.cpp:4:
In file included from
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/regex:58:
In file included from
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/regex.h:2721:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/regex.tcc:637:11:
error: member function '_M_end_of_seq' not viable: 'this' argument has type
'const std::regex_token_iterator<__gnu_cxx::__normal_iterator<const char *,
std::basic_string<char> >, char, std::regex_traits<char> >', but function is
not marked const
if (_M_end_of_seq() || _M_suffix.matched
a
^~~~~~~~~~~~~
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/regex.h:2690:7:
note: '_M_end_of_seq' declared here
_M_end_of_seq()
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141007/7d8435b8/attachment.html>
More information about the llvm-bugs
mailing list