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

    <tr>
        <th>Summary</th>
        <td>
            Provide a way to enable individual warnings in system headers
        </td>
    </tr>

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

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

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

<pre>
    When a header is marked as a system header (e.g. with `--system-header-prefix`), most warnings are in those headers are ignored, unless they are marked `ShowInSystemHeader` in the tablegen config.

If I want to make sure a given `-Wfoo` warning does not trigger within a system header, there is no good way to do this. Simply not declaring it as a system header is not feasible since generally system headers are not warning-clean. Updating the tablegen config to include `ShowInSystemHeader` is a simple code change but means needing to rebuild clang, and a large codebase often does not compile cleanly with clang near trunk -- either clang has a bug, or clang catches some existing issues in the code that a slightly older clang does not catch.

Ideally we would have `-Wsystem-error=foo` that would behave as if `-Wfoo` is not only enabled, but part of the `ShowInSystemHeader` group and thus will be triggered in system headers. This is especially useful if a clang warning is scheduled to become an unignorable error.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VMtu6zYQ_Rp6M7BAS7brLLRIGwTNrkBa3PWIHJPTUKTAR3z99wUppUHa225sQDOc85hDYkpsPNEoTj-L09MOS7YhjrEsSyRl824K-j5-s-QBwRJqisAJZoxvpAETIKR7yjR_FEV_oc50cONsQZzlfr_W92t9v0S68ndxlqJ_EP0vMIeU4YbRszcJMBKwh2xDom3i9tH4EEnXE8U7SgmypXsrbVzEWb7acHvxrw3v13ZYnOU6jyDj5MiQBxX8lU0n5JOQj-vvyxVe4IY-Qw4w4xtBKpEAwfA7-Sbj2zWEOm2jCjpQAh8y5MjGUGyC2f_Tj0o4W6oKajuYEDTc8F6BdIBsOXXwyvPi7m2aJuUwVgDOP7KXV9ArYeLJEST2isCQp4jO3b92r9bV_o31XjlC38Efi8ZcQX5gTGXGXrmi6X88bcwqbQIVNIGy6A3BVDLMhD6BJ9INIUCkqbDToBx6Uw1BrwHBYTTr6QkTQbhm8p-2qjAvXKdXxu6-5qlNAE8YIcfi32C_B-Lq71ayzbKpNJjw8VVhVpYSpDAT0HdOTTunVCh9xKOpyBZzFebY2OzuEJz-e_Qnszrta3w0NfNvBLdQnAaL77SmZgs_xRiiGJ62EDWctXWi1owJ-PolaNumQxVPvu6opb86vGDMEK6N93-uyMRQlmZ1tiXBjZ2DiT7iSroK_5qWDn63nCowpYUUN00l0bW4Sg43Iz5uACdIypIujnRd80Sq-oseim_XtXKGprzb6XHQD8MD7mg8nC_nw-V0PPc7O_6khuGg8NQP8uE46NOBjmo4Xi8HeZSq7_WOx172gzzLi5Sng-w7qehwkni5KK0kXSZxlDQju86597kL0ezaYsfzcLjIncOJXGqvW9-vARweNaPxIWVWSfR9ffbiWE_vp2KSOErHKafPeZmzo_G3GN5Z10dhu77rUoC95nfWBd3nM_Yva3clutHmvCQxPIr-WfTPhrMtU6fCLPrnirX97ZcY_iSVRf-8JlT0z03LXwEAAP__lc72jA">