<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 --- - unexpected "use of overloaded operator '==' is ambiguous""
href="https://llvm.org/bugs/show_bug.cgi?id=31078">31078</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>unexpected "use of overloaded operator '==' is ambiguous"
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.9
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>blastrock@free.fr
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The following program compiles on clang 3.8, gcc 6.1 and msvc 19 but not on
clang 3.9 and trunk 287442:
struct Master
{
};
struct A : Master
{
using Master::Master;
};
bool operator==(A, A) { return true; }
struct B : Master
{
using Master::Master;
B() {}
B(A) {}
};
bool operator==(B, B) { return true; }
int main(int argc, char* argv[])
{
A a;
B b;
a == b;
}
It says that there are two candidates for the operator== call at the end of
main. Since there is no possible conversion from B to A, the only correct
overload should be the one with B arguments.
I am not sure but it seems that clang accepts constructing an A from a Master.
This line compiles on clang 3.9 but not on gcc 6 and msvc 19:
A aa = Master{};
I don't know what the standard says and which compiler is correct though...</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>