<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Wrong program output in case of many concept conversion operators"
href="https://bugs.llvm.org/show_bug.cgi?id=51291">51291</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong program output in case of many concept conversion operators
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>12.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>fchelnokov@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Example code:
```
template <auto =[]{}> class C;
template <typename, typename = C<>> concept x = true;
#include <iostream>
struct S {
operator x<C<>> auto() { return 42; }
operator x<C<>> auto() { return '+'; }
operator x<C<>> auto() { return 44LL; }
operator x<C<>> auto() { return 45.5; }
operator x<C<>> auto() { return 46.5f; }
operator x<C<>> auto() { return 47L; }
operator x<C<>> auto() { return 48ULL; }
operator x<C<>> auto() { return 49U; }
};
int main() {
S s;
std::cout << (int)s << "\n";
std::cout << (char)s << "\n";
std::cout << (long long)s << "\n";
std::cout << (double)s << "\n";
std::cout << (float)s << "\n";
std::cout << (long)s << "\n";
std::cout << (unsigned long long)s << "\n";
std::cout << (unsigned)s << "\n";
}
```
Clang prints here:
```
49
1
49
0
0
49
49
49
```
which is obviously wrong.
Demo: <a href="https://gcc.godbolt.org/z/dPa4GxYhc">https://gcc.godbolt.org/z/dPa4GxYhc</a></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>