<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/126392>126392</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Clang] Accepts invalid lambda init-capture shadowing a template parameter
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          MagentaTreehouse
      </td>
    </tr>
</table>

<pre>
    In the following code, the init-capture of the lambda has the same name as the NTTP `i`, which should not be allowed.
```c++
template <int i>
int f() {
 return [i = 0] { return i; }();
}

int i = f<0>();
```

This is diagnosed by GCC and EDG.

See https://compiler-explorer.com/z/oh7MhabG9.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxUUsuO2zoM_Rp6Q8SQ5Ve88CKPyeAu5qJA8wOyxFgqZMuQ5JlOv76Qk7QdgLBF8hxSpI4IwYwzUQ_1EepzJtaone_fxEhzFFdPpN0aKBuc-uz_mzFqwpuz1n2YeUTpFAE_bVEzm7iTYomrJ3S3LWbFNCiBWoTNDWIinNPnEfj_ev2G0DADDUt1PrSRGoN2q1U4u4gDoUjNSOXADgm1mQR-TMYOkabFikgI5cnMEQ2UL8AO6XgDvgfeIbQJiJ7i6meE-mgQyjMyqM8p90wYKI8I7fnOgjKRkssOj3p32g3KE0tN_oU973UHX7UJaAIqI8bZBVI4fOLr6YRiVvhyfs3vsO9EqGNcApQH4BfgF-mmxVjyO_q5WOfJ59JNwC-_gF-cbt-0GF67PFN9qbqyExn1RVt2rCmaZp_pvpBNJauGyj2vhqIdVF0Xshp429VKUHnLTM8ZrxlnHWNVwfa5GjjRjVdStftC7muoGE3C2Nza9yl3fsxMCCv1BW_KjmdWDGTDJhXOpRXzCJwn1fg-EXbDOgaomDUhhr8lool209dpY9RnPEhJSwxo5ndhjXrK5IuCghbqLjKBfx55EV5MFMlnq7f91-WNJup1eGwsNX_8dot3P0hG4JdtmAD88pjnvee_AwAA__-DHuyG">