<html>
<head>
<base href="http://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 --- - (N2439) Clang incorrectly reports ambiguity between reference-qualified member functions"
href="http://llvm.org/bugs/show_bug.cgi?id=18359">18359</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>(N2439) Clang incorrectly reports ambiguity between reference-qualified member functions
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>j4cbo@dropbox.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Given the following:
#include <memory>
using std::shared_ptr;
struct Foo {
operator shared_ptr<int> const & () const & { return data; }
operator shared_ptr<int> && () && { return std::move(data); }
shared_ptr<int> data;
};
int main() {
shared_ptr<int> x;
x = Foo();
}
Clang ("Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn)")
reports:
ambiguous-reference.cpp:12:7: error: use of overloaded operator '=' is
ambiguous (with operand types 'shared_ptr<int>' and 'Foo')
This seems wrong - if I'm understanding N2439 correctly, then the
rvalue-reference-qualified version should be preferred.
Replacing shared_ptr with unique_ptr in the above also fails due to ambiguity,
even though one of the two candidates (uniuqe_ptr's copy assignment operator)
is implicitly deleted.</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>