<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/162092>162092</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
templated lambda, requires, __is_same and type traits
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
codethinki
</td>
</tr>
</table>
<pre>
Somehow __is_same doesnt like type traits evaluated inside of it when in function instantiation context:
```cpp
using type = std::vector<int>;
using inner = int;
template<class T>
concept range_value_int = std::same_as<std::ranges::range_value_t<T>, int>;
template<class T, auto Cpt>
concept generic_range_value = requires {
Cpt.template operator()<std::ranges::range_value_t<T>>();
};
template<class T> requires generic_range_value<T, []<std::same_as<int>>() {}>
void z() {}
template<range_value_int T>
void y() {}
template<generic_range_value<[]<std::same_as<int>>() {}> T>
void x() {}
int main {
static_assert(
generic_range_value<type, []<std::same_as<int>>() {}>,
"fuck"
);
y<type>();
x<type>();
}
```
This does not compile and fails at the instantiation of "x" on the templated lambda operator call. it interestingly doesn't fail when calling it inside the static assert or when its evaluated in a requires clause behind the function.
msvc compiles it just fine.
version stuff:
```
clang version 20.1.8
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\Microsoft Visual Studio\18\Insiders\VC\Tools\Llvm\bin
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVU2L4zgQ_TXKpehgy7GTHHzIuCcwsAsL08w1KFbZqWlZ8krldPf--kV20vnYMLATDLGlqnqvPvSkQqDWIpYi_yLy55ka-OB8WTuNfCD7SrO90x_ld9fhwb3BbkdhF1SHoB0Gy2DoFYE_egT2ijgAHpUZFKMGsoE0gmuAGN4OaIEsNIOtmVx8D6wskxq_amcZ31lkG5FsRJFMT933ItkMgWw7YYjsGQLraJZtjliz8yKryLLIvorsy6cxWYt-tB734sb0MHa9UYwiq2qjQoCX6Jlsamdr7Bm8si3uYgq4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