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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy gives incorrect result for `__has_builtin`
        </td>
    </tr>

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

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

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

<pre>
    `clang-tidy` sometimes gives the wrong result for `__has_builtin`.

For example:

```
#if !__has_builtin(__builtin_os_log_format)
#error "Needs built-in"
#endif

int main() {}
```

gives an error (https://godbolt.org/z/fWdz4zx6h), even though the built-in is actually there (https://godbolt.org/z/oE567Yeve)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMUkGPmzwQ_TXDxUpkBoPhwGH3y8ex16onZMwArgxe2Sa7ya-vIEmzrSq1Ehpszcx7z09PhWDGhaiG_BXyU6LWODlf-zUEsnbWOulcf6mh4NqqZTxE01-g4Cy4maKZKbDRnCmwOBF7924Zmaew2sgG5xkUvG0nFdpuNTaaBQp-BH4C_nKrjfOMPtT8Zgmyl88dKPj9u10xMwMDTH-Fw7J9nFsXWuvGdnB-VhGw-rlI3m9SEL8Q9YHt84dtGZ8jS2-Gz_RmiWxWOwNgxUC-gjz9Wdlebx6ohT3IyinGt7A9ChvAZnR952w8Oj8CNlfAZvjaX8X1o5g2qfgfozMtLE5uHafdy4dMZgJTOq7K2svW8PQv6O7_vJDf6EyAVdLXWV9llUqoTguJskyFKJOp1nIoi1LJTqLOqFddOWSDzvsu7YREUSWmRo4ZT3mGacZFeRS57ITgElNdDbkWIDjNytijted5o09MCCvVeVVymVjVkQ17sBAXemd7c_M9PyW-3nYO3ToGENyaEMMTJZpoqX4G7p4xs2jnPen4l4wlq7f1bxaZOK3dUbsZsNl47r_Dm3ffSUfAZlcXAJtd_Y8AAAD__y-A9sk">