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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Function SFINAE'd out but still leads to compiler error - compiles on GCC and MSVC
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            diverges-from:gcc,
            diverges-from:msvc
      </td>
    </tr>

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

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

<pre>
    Hi!

Consider this example:  https://godbolt.org/z/r9fKhr6Ma

The goal is for the `foo` and `bar` functions to be SFINAE'd out under the same condition. `bar()` and `foo()` are always enabled or disabled together. `bar` calls `foo` only when both `bar` and `foo` are enabled.

However Clang complains that `bar()` is calling the `delete`'d overload `foo`, which should not happen as per above. GCC and MSVC do not error and compile just fine.

So I wonder if this is a bug in Clang, or are GCC and MSVC being less restrictive?

Thank you!

 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0U01zrDYQ_DXiMrUUiI9dDhw26xC7Us7FqdwFGkCO0FCSYLP-9Sk-9nntV-8Ekqa6e3qmhXOqM4gly35j2VMgJt-TLRthNblO6Bk_xqAmeSufFeMxi84sOl_IOCXRgu-VA_xPDKNGlpwBeu9Hx5Iz4xXjVUeyJu1Dsh3j1QfjlS3aP3ubv4oN6O8eoSOhQTloacFDYHnUErE8AmHkcqqFXU7tZBqvyDjwBDXCW_Xy1_l3xo8SaPIwmU0QghMDQkNGqqU8vEPwE-PFA-xC8nlnEYS-ipsDNKLWKIEsSOW2f08d-h5t-KCnEVq7B7Vk9A2uPRqoyfcPhQ98O9NOEW4mPNMVZ7Rw0cJ00NAwaqGWNnvhfxKv3EqsTHc3S6JGjyyPNitmtJrEAyPjF7j2qunB9TRpCYY89GIc0YBwMKIFUdOMIfxxuaxiX9_-uYCktRCtJbveLsKURnifnIdWGdzlvxG8wJVW-1W7rYRyIKCeOlBma2sRseBY_MpS49KJRufAovNWNV7NyJLqvh_C_As3mn6sHgSyTGSRFCLAMj5meZQnR14EfXlqizQv4rQpCl4kURHxOI152-R1Lo8nLgNV8ohn0YmnccFPaRHmss2btD0iRkdZYMrSCAehdKj1PCxLGyjnJizjLItPRaBFjdqtQeG8WbtKzq0l49FIxjnjF8a5VDPaDt2htTSw5Nw1zS_fBjevj9lTYMuF9FBPnWNppJXz7lOGV16vCd1Ysyeo9jB8T0E9eXBeaQ0ahVyjss_N7qM83C8ckPkyjGCyuvwWYOX7qQ4bGhivFjn75zBaesfGM16tFjnGq92lueT_BwAA__-Fj2B2">