<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/107778>107778</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] Failure to compile templated comparison of templated class where member variable and class have the same name
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Infirmarian
</td>
</tr>
</table>
<pre>
When constructing a templated class with a member variable of the same name as the class, the use of that member variable in a templated function that uses the less-than operator causes compilation failure. This isn't the case for member variables with a name different from the enclosing class, or if the class, or if comparison function isn't templated, and also compiles perfectly fine in GCC
Godbolt: https://godbolt.org/z/r9TfP66eG
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkUs1upDwQfBpzaWUE5v_AId9ERN9tD5H23Jj24JWxkdvMKvv0K2Ay2UwuRri7uqvKhczm4og6Uf4nypcE1zj50P3vtAkzBoMuGfz43v2cyIHyjmNYVTTuAgiR5sVipBGURWb4beIECDPNAwW4bujBEngNcSJgnAncdiDvFztIyPP-s_KtEeO3AcZ9WaZXp6Lx7mhemY5xlpif4oQO_EIBow-gcK8qPy_G4o7RaOwa6ARvk2Ew7ISs40EHmUD78Lj-rmvnPhqtKZCLoIOfdyA5ZT1vltwV-QBGfxV5XG1UMBjemHzIuJP4ULi1oxsBLfsbeWJYKGhS0b6DNm435fV8FumLSJ-P89WPg7dR5M8wxbiwyJ-F7IXsL0fh5MNFyP6PkH1o3_SPqqLXZOzysc1bTKjLalk2eVZkVTJ1Q9HoVmFRFnUxYlNnWa5U0wyq0m1ayTExnUxlkbZpI7O8KqtTURZDRRWO2FZU17UoUprR2JO113nbnRjmlbosreu6SSwOZHmPnZTKorsIKbcEhm4DPA3rhUWRWsORP0dEE-2e1fOOKF-gPx4U4t2qf3P5afcWrse8ThToW9o254_6hFf6Gt1kDbZ7MNfEaR1Oys9C9hvP2-dpCf4XqShkv-tmIfub9Gsn_wYAAP__IbAvGw">