<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - map<const, const> fails copy-assignment"
href="https://llvm.org/bugs/show_bug.cgi?id=23304">23304</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>map<const, const> fails copy-assignment
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>eugeni.stepanov@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>#include <string>
#include <map>
int main() {
std::map<const std::string, const std::string> m1, m2;
m1 = m2;
}
As I read the standard, the only requirement is that pair<const std::string,
const std::string> must be CopyInsertable, and it looks like it is.
Error text:
In file included from ../1.cc:1:
In file included from /code/llvm/build/bin/../include/c++/v1/string:439:
In file included from /code/llvm/build/bin/../include/c++/v1/algorithm:627:
/code/llvm/build/bin/../include/c++/v1/utility:299:15: error: no viable
overloaded '='
first = __p.first;
~~~~~ ^ ~~~~~~~~~
/code/llvm/build/bin/../include/c++/v1/map:610:15: note: in instantiation of
member function 'std::__1::pair<const
std::__1::basic_string<char>, const std::__1::basic_string<char>
<span class="quote">>::operator=' requested here</span >
{__nc = __v.__cc; return *this;}
^
/code/llvm/build/bin/../include/c++/v1/__tree:1265:35: note: in instantiation
of member function
'std::__1::__value_type<const std::__1::basic_string<char>, const
std::__1::basic_string<char> >::operator='
requested here
__cache->__value_ = *__first;
^
/code/llvm/build/bin/../include/c++/v1/__tree:1206:9: note: in instantiation of
function template specialization
'std::__1::__tree<std::__1::__value_type<const
std::__1::basic_string<char>, const std::__1::basic_string<char> >,
std::__1::__map_value_compare<const std::__1::basic_string<char>,
std::__1::__value_type<const
std::__1::basic_string<char>, const std::__1::basic_string<char> >,
std::__1::less<const
std::__1::basic_string<char> >, true>,
std::__1::allocator<std::__1::__value_type<const
std::__1::basic_string<char>, const std::__1::basic_string<char> > >
<span class="quote">>::__assign_multi<std::__1::__tree_const_iterator<std::__1::__value_type<const</span >
std::__1::basic_string<char>, const
std::__1::basic_string<char> >,
std::__1::__tree_node<std::__1::__value_type<const
std::__1::basic_string<char>,
const std::__1::basic_string<char> >, void *> *, long> >' requested here
__assign_multi(__t.begin(), __t.end());
^
/code/llvm/build/bin/../include/c++/v1/map:898:21: note: in instantiation of
member function
'std::__1::__tree<std::__1::__value_type<const
std::__1::basic_string<char>, const std::__1::basic_string<char> >,
std::__1::__map_value_compare<const std::__1::basic_string<char>,
std::__1::__value_type<const
std::__1::basic_string<char>, const std::__1::basic_string<char> >,
std::__1::less<const
std::__1::basic_string<char> >, true>,
std::__1::allocator<std::__1::__value_type<const
std::__1::basic_string<char>, const std::__1::basic_string<char> > >
<span class="quote">>::operator=' requested here</span >
__tree_ = __m.__tree_;
^
../1.cc:6:6: note: in instantiation of member function 'std::__1::map<const
std::__1::basic_string<char>, const
std::__1::basic_string<char>, std::__1::less<const
std::__1::basic_string<char> >,
std::__1::allocator<std::__1::pair<const std::__1::basic_string<char>,
const std::__1::basic_string<char> > >
>::operator=' requested here
m1 = m2;</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>