<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/106865>106865</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] NTTP pointer to explicit this member function
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vasama
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/Ez55zEedh
```
C:\Users\vasama\sandbox λ cat test.cpp
template<auto>
struct nontype_t {};
template<auto Value>
inline constexpr nontype_t<Value> nontype{};
template<auto F>
void f(nontype_t<F>);
struct s
{
void f(this s);
};
void g()
{
f(nontype<&s::f>);
}
C:\Users\vasama\sandbox λ clang --version
clang version 18.1.8
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
C:\Users\vasama\sandbox λ clang -std=c++23 test.cpp
test.cpp:5:28: error: must explicitly qualify name of member function when taking its address
5 | inline constexpr nontype_t<Value> nontype{};
| ^~~~~
| s::
test.cpp:17:4: note: in instantiation of variable template specialization 'nontype' requested here
17 | f(nontype<&s::f>);
| ^
test.cpp:5:28: error: must explicitly qualify name of member function when taking its address
5 | inline constexpr nontype_t<Value> nontype{};
| ^~~~~
| s::
test.cpp:17:4: note: in instantiation of variable template specialization 'nontype<&s::f>' requested here
17 | f(nontype<&s::f>);
| ^
test.cpp:17:2: error: no matching function for call to 'f'
17 | f(nontype<&s::f>);
| ^
test.cpp:8:6: note: candidate template ignored: substitution failure [with F = &s::f]: must explicitly qualify name of member function when taking its address
8 | void f(nontype_t<F>);
| ^
9 |
10 | struct s
11 | {
12 | void f(this s);
13 | };
14 |
15 | void g()
16 | {
17 | f(nontype<&s::f>);
| ~
3 errors generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVk2PozgT_jWVSykR2AGSQw75lF5p3tUceuc6MlAB7xqbsU3649C_fWWg00m6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