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

    <tr>
        <th>Summary</th>
        <td>
            [Clang] Specialize diagnostics for std::launder
        </td>
    </tr>

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

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

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

<pre>
    Clang diagnoses erroneous uses of `__builtin_launder`, but doesn't produce nice diagnostics when it's used in `std::launder` currently. `__builtin_is_constant_evaluated` detects when it's used inside `std::is_constant_evaluated` to produce nicer diagnostics. It would be great if clang could do this too for `__builtin_launder`, since it would allow us to remove a few `static_assert`s inside `std::launder` in libc++ to get some really nice diagnostics for this.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8ks1u2zAQhJ-GuiwiSJRsWQcd8gMDPfcBDIpcSdvSpMFd2kifvpCaIEmT9iRwgf12ZjSGmeaAOKjdg9o9FSbLEtNwWcgH-tl1XTFG9zw8ehNmcGTmEBkZMKUYMGaGvD7jBGpfnU5jJi8UTt7k4DCpfaX0I4xZwEXkoHQncEnRZYsQyOIrUcgy3BYMQKJ0t1EdUFipLE4196q5f4OCzSlhEP9cfrxLfLIxsJggJ7wan42gWxccClr58gaTww93_gmR-EF8eq--hG8Ct5i9gxFhTmgEaAK75Wa3uYsgCzFIjDDF9L_EmIJFoFei8T7eIK-rkPAcrwgGJrz9kW2E7MkwY5L1_ZWld9FRAE-jVfpB6YcVOKMAxzNCQuP98-f_smpdhZeFGxrXN70pcKg7va_aum6bYhm6Q13V9tC3bpr6fupb3E-NM_3BtqZvRlfQoCvdVn1dV91O66bcVQerpxa70Tnjml61FZ4N-dL767mMaS6IOeNQV4d6XxXejOh566jWW6aquX-nUWm9ljcN6_rdmGdWbeWJhd-AQuK3mm9dVrsn-H5BS8bTr89-_06uyMkPi8iF17E-Kn2cSZY8ljaelT6uV14-d5cUf6AVpY-bB1b6-GLjOujfAQAA__-oUyie">