<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 - [concepts] ambiguous overload accepted as valid"
href="https://bugs.llvm.org/show_bug.cgi?id=49964">49964</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[concepts] ambiguous overload accepted as valid
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>11.0
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ldalessandro@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Clang accepts the following concept code that gcc considers ambiguous (reduced
testcase due to Patrick Palka).
```
template <class T> concept C1 = true;
template <class T> concept C2 = C1<T> && true;
template <C1 T, C1 U> int f(T, U);
template <C1 T, C2 U> int f(U, T);
int x = f(0, 0); // expect error: ambiguous call
```
Live: <a href="https://godbolt.org/z/6K93d1Ye4">https://godbolt.org/z/6K93d1Ye4</a>
I originally submitted this as a gcc bug
(<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99963">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99963</a>) but Patrick and Jason
Merrill determined that gcc's behavior is correct.
According to their reading of the standard (I don't have the background to make
this statement), this call to f should be ambiguous because the matching
between the template argument index and function argument index is different in
its two declarations.</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>