<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/84020>84020</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Compiler error for delayed template in
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rath3t
</td>
</tr>
</table>
<pre>
The following code fails to compile with clang trunk and clang 16 (See godbolt link).
The templated member function is not found by clang and therefore the `static_assert` is triggered.
The struct `A` inherits from `T` and therefore the base class member function `foo` exists, thus the `static_assert` should not trigger.
It works for non-templated base class member functions though.
```cpp
#include <type_traits>
template <typename T>
struct AlwaysFalse : public std::false_type {};
struct B {
template <typename S>
void foo();
void bar();
};
template <typename T, typename S>
struct A : T {
auto foo() {
static_assert(requires { T::template foo<S>(); }); //fails with clang
static_assert(requires { T::bar(); }); //works with clang and gcc 12.2
}
};
int main() {
A<B, double> a;
a.foo();
}
```
[Godbolt](https://godbolt.org/z/cadYdMj17)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2P4ygQ_TX4UuoIg-3YBx-S9GS1hz1NX_bUwqZsM40hC3iy2V-_wnE-ujM5jBQpBqree_WgSniveoNYk3xL8tdETGGwrnYiDDwkjZWn-m1A6KzW9qhMD62VCJ1Q2kOw0NrxoDTCUYUBWi1MD8FN5gOEkcs6LQAIK78jQm9lY3UArcwHYdWK0FdCNxE_4HjQIqCEEccGHXSTaYOyBpQHYwN0djISmtMCGuHDgA476zB-ASmoDyKo9l14jy6Qgsbc4FTfo0O5kN0ofXBTG2LeZo41AzoVPHTOjnH3Le4-8jTCYxTh_YNUUtDO2piG_yofPGE7CMPkn-rzg520nOtbdC4q_wxwtO7DQ2cdGGtebv485488duqHT5WSgp5_7eGw7DCuTKsniUD4LpwO-B6cUMET_u0-80J5iTJiRHi7Bi32bfRRnPxeaB8DN3CYGq1a8EESviF808WT95gPZL0l61fCt_csC8x2Pp13AAB-yf39yg0_rZIQvWYlYdUXyAgwBzTCfQ144H9SZby5R95LzXOlb58liynYm6S7s8-3zkqH_0zKoY8h0c_o0lVFBOC7mfGiHKLo5YvtCdufm-_Wcb_Bc-_IA-75xd11cnz8fdtCylZsIYk5T5xUJsAolHkwAAA2hO-20VRpp0Yj4d9AXNNBrH5xlVeiywNelvn2j_MUIfkrYeUQwsHH4uYSlgGzsq4nbP8fYftWyL_lXz_SNWFVImsuK16JBOt0TasiqzhfJ0PdVnlWpkWZYtm02botWUELlmPG0lTKQiaqZpRllNM8zXjO16s1ZU1TFA1tyornSElGcRRKr7T-OUb6RHk_YV1mlNFEiwa1n0csYwaPMB8SxuLEdXXMeWmm3pOM6jg4bihBBY317jxlHaBz1s1DQaIWJ5S3TlEmmZyuv_ihwjA1q9aOhO0j6PL3cnD2B7aBsP0sxRO2n6X-HwAA___MxNe_">