title: Using #pragma to remove clang warnings based on clang check
body: <p>I want to remove/ignore a clang warning for a block of code and found multiple examples of how to use pragamas for this. For example if the warning is <code>unused-variable</code> you can disable it by using:</p>
  <pre><code>#pragma clang diagnostic push
  #pragma clang diagnostic ignored &quot;-Wunused-variable&quot;
  
  int a;
  
  #pragma clang diagnostic pop
  </code></pre>
  <p>However the problem is that I do not get a warning in the output when building the repository, I only get to know which clang check it is that gives the warning... And I can not find any other questions or documentations where this is the case. This is what my output looks:</p>
  <pre><code>warning: Use of memory after it is freed [clang-analyzer-cplusplus.NewDelete]
  </code></pre>
  <p>I have tried hundreds of different combinations of how to ignore this but nothing works (using <code>// NOLINT</code> is not a viable option). Among the things that i have tried, here are some:</p>
  <pre><code>#pragma clang diagnostic push
  #pragma clang diagnostic ignored &quot;-Winline-new-delete&quot;
  #pragma clang diagnostic ignored &quot;-Wmost&quot;
  #pragma clang diagnostic ignored &quot;-Weverything&quot;
  #pragma clang diagnostic ignored &quot;clang-analyzer-cplusplus.NewDelete&quot;
  #pragma clang diagnostic ignored &quot;-Wclang-analyzer-cplusplus.NewDelete&quot;
  #pragma clang diagnostic ignored &quot;-clang-analyzer-cplusplus.NewDelete&quot;
  #pragma clang diagnostic ignored &quot;-W-NewDelete&quot;
  #pragma clang diagnostic ignored &quot;-W-new-delete&quot;
  
  // code
  
  #pragma clang diagnostic pop
  </code></pre>
  <p>Note, &quot;fixing&quot; the code is also not an option since it is third party code.</p>