Revert "Fix for unused-lambda-capture warning"

This reverts commit d0d9928f376ccb88b83a03cf15eb5913e720663e.

Reason for revert: This broke build, NumElements needs to be captured in debug build

Change-Id: If5d8579a48229af9ff5a75dc7baeb544b195b746
Reviewed-on: https://swiftshader-review.googlesource.com/c/22288
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Takuto Ikuta <tikuta@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be19aed..fb94ffe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -203,7 +203,6 @@
     set_cpp_flag("-Werror=reorder")
     set_cpp_flag("-Werror=sign-compare")
     set_cpp_flag("-Werror=missing-braces")
-    set_cpp_flag("-Werror=unused-lambda-capture")
     set_cpp_flag("-fno-exceptions")
 
     # Remove xor, and, or and friends from the list of keywords, they are used
diff --git a/third_party/subzero/src/IceTargetLowering.h b/third_party/subzero/src/IceTargetLowering.h
index 63db6b4..5cb42e6 100644
--- a/third_party/subzero/src/IceTargetLowering.h
+++ b/third_party/subzero/src/IceTargetLowering.h
@@ -530,8 +530,8 @@
     for (SizeT I = 0; I < NumElements; ++I) {
       auto *Index = Ctx->getConstantInt32(I);
 
-      auto makeExtractThunk = [this, Index](Operand *Src) {
-        return [this, Index, Src]() {
+      auto makeExtractThunk = [this, Index, NumElements](Operand *Src) {
+        return [this, Index, NumElements, Src]() {
           assert(typeNumElements(Src->getType()) == NumElements);
 
           const auto ElementTy = typeElementType(Src->getType());