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

    <tr>
        <th>Summary</th>
        <td>
            [feat] [clang] [lint] `-Wunused-diagnostic-ignored`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    **Feat**

`-Wunused-diagnostic-ignored` if pragma scope delcare ignore diagnostic flag `-Wfoo`, but code don't have problem `-Wfoo`, it should be reported.

**Scenario**

Actual

```c++
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfoo"
#pragma clang diagnostic ignored "-Wbar"

code_prev_has_foo_problem_but_now_have_no_foo_problem
code_never_have_foo_problem

#pragma clang diagnostic pop
```

Expected

```c++
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wbar"

code_prev_has_foo_problem_but_now_have_no_foo_problem
code_never_have_foo_problem

#pragma clang diagnostic pop
```

**Related**
Does other linter have similar feature?

Yes, eslint report unused eslint-disable comments.

https://eslint.org/docs/latest/use/configure/rules#report-unused-eslint-disable-comments

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUlE-PmzwQxj-NuVhExAaSHDhk37x8gPZQ9YSMPQFXxoP8J-1--8pAtMnuYdVLpUqWYyXzeOb5xTPCez1YgIZUL6S6ZCKGEV1j8NWidlmP6rUh7EzYuQUR1hMpLqS473WRf4s2elC50mKw6IOWuR4sOlCkLqi-0tmJYRLUS5yBKjBSOKBrCH0T0asRA10uvCKSuiDsP9rHQCUqoAotYYdAR3EDOjvsDUzvg3WgfsRoFO2BOpjRBVC7p3IXA18lWOE0frRzliEK887guiRhL2lt9_DNlDTCDo8u5ujHT4M2PpQwthpg7M80vXBvmmVPlLrZwa0bhe-uiN1Gqetj6Cz-7BK6zuLjbw9SCzdwa8yHgM9N4_wO16Pw_18zyADqL3P9pxitb_ELGJFAPTzMC4KnGEZw1GgbwK0t4PWkjXD0CiJEB4S3j7d9B58aAnySbK1A1zbdvsyV9qI3QCVOE9jgn_pkDGH2hJ8JawlrV8UO3UBYq1B6wtpUpw-EtdEDYa1Ee9VDKoS1LpqUnq9p8206PKfN72nXfJlquDrxk8ig2dfH8nSsysM-G5uy38vTgZdQHflBcVWqEvjxVFYl1GVd8Ew3rGC8qFhVcL7f73ei4CcBx6IUQjBZAykLmIQ2O2NuU_KQae8jNDU78SIzogfj79PPNSko7-PgSVkY7YN_kwUdzDInE3JSXSipXpY_eTsne8vxs5GYRWeaZ8KDDmPsdxKnhNbc7h_57PAHyMR5qTqRXwr_HQAA__-itdBj">