title: Unused lambda capture warning when capture is actually used
body: <p>This code:</p>
  
  <pre><code>void foo(int);
  int main() {
      const int i = 0;
      auto l = [i](){foo(i);};
  }
  </code></pre>
  
  <p>(<a href="https://godbolt.org/z/7qJDUS" rel="noreferrer" title="godbolt">godbolt</a>)</p>
  
  <p>Will issue a compiler error when compiled by clang with </p>
  
  <p><code>-std=c++17 -Werror -Wunused-lambda-capture</code></p>
  
  <p>The error message is <code>error: lambda capture 'i' is not required to be captured for this use</code>.</p>
  
  <p>The error is correct: <code>i</code> could be implicitly captured here, explicitly capturing it is not necessary. However, a) the warning is poorly named, since <code>i</code> is used but the warning is for <em>unused</em> lambda captures, and b) I would just not like this to be an error. I want to error for actually unused lambda captures, but not error for used explicitly captured variables that could have been implicitly captured.</p>
  
  <p>Is there a clang setting that does this? Or do I have to squelch the error using pragma diagnostic push/pop?</p>