<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVE2PmzAQ_TXkMlpE7ISQA4dk00i9VFVVqcfK2AN418GsbbIfv75jQrKb3XYvjSCYsefx5s2zK6uey68dhBahtsbYR901IK3ChN3GqEPQHgIeeiMCQpJnPrhBBtjQEB51aKGz4SY89_i6SrhmOGAXIoboVMySRngP25ikkF4c-hjeJPw2S_iXGBcedPBQO42dSuFniydeBzxU6KAeOhm07c5pTzGN02jTCv9bSIneJ6xI2DqCEenBo4JgQbYo7wlJBMIHWgynxXGud_o41bU9gfUXjPie7ZIsVjpd4-u5TOIghmAjjTF-FgaS1fYUAfr5IIKWJGnnAz71DiprDXygzKeUZLV7HY__k3LXqEerFUxUxxlKu0yeFIRLoyaJ__2JdxXB06Wmd7Q_1_2aosMwuI4eD4OmbtOSLVTTKqjS_lI4XBE6F3LWNKr3mxRAR3YqIGHzSGL-CYm3al53bkOq6A5ujSCTTzaaT-5rMPzNGLVGozzY-mSRPEvhmw3gbQSycYNQaw-9Nuh8Cjs8kB820IbQ-8iP7elqpEwbqyprQmpdQ5EXuuvVw3eb193d23p_YOyDAqW9HLwnu3-EI03kvT2iq2m7pvR1ij3QvcqKOVsURRxytlyu1zNVcrXmazGjtrbWlXtUbjY4U74jSNt4qCYoY47nx03v7B1KEn6vvR9iE_dLzvPFrC0VoqzzxaooGMpC8CzjIpNszkW-XKyVmhlRofFlstwmjHX4CCMEjZPlbvb_DHTJMsayOeNZztbzPOULvlIyy4tCcZkpkSwyPAht0ogTdZ-5coSshsbTpNE--NdJsphuOsSRMDEMOhgsfzlLVvE9Si2MfhHjAVQh8cTzSRXPrfGIobZVzxe_38Rdg2MLZyP1cuT9B4-Dpds>53364</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Wrong specialization becomes friend as checked by requires-expression
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    In the following code, there is template `struct A` with not-type template argument, and `class B` declares `A<0>` as its friend. Then the member function `A<x>::has_access()` is used to check that it has access to private `B::p()`:
```
template<auto>
struct A {
    static constexpr bool has_access();
};

class B {
    void p() {}
    friend struct A<0>;
};

template<auto x>
constexpr bool A<x>::has_access() {
    return requires(B b) { b.p(); };
}

static_assert( !A<1>::has_access() );
```
And in Clang `A<1>` gets access to private fields of `B`. Not so in other compilers. Demo: https://gcc.godbolt.org/z/f7qPo6fnj

Related discussion: https://stackoverflow.com/q/70812488/7325599
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VE1vozAQ_TVwGRURkxBy4JA0G2kvq9VqpT1Wxh7ArcHUNunHr98xIWnT7hbxYY89z2_ezFAZ-VJ-78G3CLXR2jypvgFhJEbsNlgtgnLgsRs09whRnjpvR-FhS0N4Ur6F3vgb_zLg2y5um7HD3gcM3svgJTR3DnbBSSJNLLpg3kbZbRpl34KdO1DeQW0V9jKB3y2eeHXYVWihHnvhlenPbs_BLaPRtuXujguBzkWsiNgmgBHp0aEEb0C0KB4IiXvCB9oMp81hbbDqOMe1O4ENF4wwT_dRGiKd72l6DpM48NGbQGOyn4WBaL07WYAu57lXgiTtncfnwUJljIZPlLPZJVrv38bTe1buGvVolISZ6rRCbpfFk4JwSdQs8f-P-BARPF9i-kD7a92vKVr0o-3p8zgqyjZt2UE174IqGS6BwxWhcyBnTYN6d6QAWiqnAiK2CCQWX5B4r-Z15rakiurhVnMq8rmMFnP1Nej_VRi1Qi0dmPpUInmawA_jwZkAZEKDUGq7QWm0LoE9dlQPW2i9H1zgxw50N0IkjZGV0T4xtiHLKz31-vGnyev-_n28vzDkQYJUTozOUbl_hiNNxIM5oq2pXRM6nWyP9KzTYsGWRRGGGVutNptYlpncZBsee-U1ln-socDdgEJxrV751E4VEgSe-y504dQwRKJ6uWTvJtQAToTi0eryQ4D0GxirmYrWx_PnZrDmHgUl7qCcG0MRHFZZli_jtpRiIQpkOcslx6UUa2RiLVLiXW0w48tY8wq1K6PVLmKsxyeYIGgcrfaxKlnKWLpgWZqzzSJPsmW2liLNi0JmIpU8WqbYcaWTwCOoHttyolSNjaNFrZx3b4tUYKrpEafjCJ_aoDW2PKC08XRuOfH-CwbtkMc">