[PATCH] D33526: Fix spurious Wunused-lambda-capture warning

Yi Kong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 26 16:45:19 PDT 2017


kongyi added inline comments.


================
Comment at: lib/Sema/SemaLambda.cpp:1524-1526
+      if (!CurContext->isDependentContext() && !IsImplicit)
+        if ((IsGenericLambda && !From.isNonODRUsed()) ||
+            (!IsGenericLambda && !From.isODRUsed()))
----------------
malcolm.parsons wrote:
> Should generic lambdas and lambdas in a dependent context be treated the same?
> 
> Is a lambda inside a generic lambda in a dependent context?
Generic lambdas are essentially templated lambdas. For diagnosing unused captures, they can be treated as the same. However we are not generating diagnoses within dependent contexts right now (L1524), so this is not really related to this fix.


Repository:
  rL LLVM

https://reviews.llvm.org/D33526





More information about the cfe-commits mailing list