<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 - Some casts to base class conversion are listed for overload resolution& template parameter deduction even though they are inaccessible"
href="https://bugs.llvm.org/show_bug.cgi?id=37617">37617</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Some casts to base class conversion are listed for overload resolution& template parameter deduction even though they are inaccessible
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.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>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>janos.boudet@nerd.nintendo.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>//The bug happens since 3.9.0 until at least 6.0.0
//declaration
template<typename... Ts> class A;
//specialization for > 0 params
template<typename T0, typename... Ts>
class A<T0, Ts...> : private A<Ts...>{};
//specialization for 0 params
template<> class A<>{};
template<typename... Ts>
void foo(A<Ts...> const&);
class B : public A<int, float>{};
int main() {
B b;
foo(b);
//it seems that there's an (erroneous?) ambiguity between
//1. foo(A<int, float>)
//2. foo(A<float>)
//3. foo(A<>)
//I expected 2 and 3 to be ignored (inaccessible), because they
//would require a reference cast to a privately inherited base type,
//and thus 1 be the only choice, with no ambiguity
//
//removing the inheritance in the >0 param specialization of A removes
//the error
return 0;
}
// compiler error clang 6.0.0
// <source>:19:5: error: no matching function for call to 'foo'
//
// foo(b);
//
// ^~~
//
// <source>:12:6: note: candidate template ignored: failed template argument
deduction
//
//void foo(A<Ts...> const&);</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>