<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 - clang++ fails to compile SFINAE member function overloaded with using-imported fallback function from base class"
href="https://bugs.llvm.org/show_bug.cgi?id=40519">40519</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang++ fails to compile SFINAE member function overloaded with using-imported fallback function from base class
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</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>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hrogers@fusionsystems.org
</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>When overloading an SFINAE-qualified member function with a using-imported
templated member function from a base class, the compiler fails to correctly
resolve the overload (the base class member function is supposed to be a
fallback).
The following code compiles with gcc since 7.1, but not clang 7.0.1. Note: msvc
19.16, icc 19.0.1 (latest on godbolt.org) also fail to compile this.
#include <stdio.h>
template <typename T, typename R = void> struct A;
struct B { };
template <typename R> struct A<B, R> { typedef R T; };
struct C {
template <typename T>
void foo(T) { puts("Hello World"); }
};
struct D : public C {
using C::foo;
template <typename T>
typename A<T>::T foo(T) { puts("Goodbye World"); }
};
struct E { };
int main()
{
D{}.foo(E{});
D{}.foo(B{});
}</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>