Description: Fix build error: no matching function for call to 'transform' std::transform
 This fixes issue #15196 (though that was accidentally closed)
 kernel_support_library.cc:99:5: error: no matching function for call to 'transform'
 std::transform(function->arg_begin(),..
 .
 python-tensorflow-cuda (1.5.0-1) unstable; urgency=medium
 .
   * New upstream release.
   * Bump tensorboard dependencies >= 1.5.0~ and << 1.6.0~.
   * Refresh Build_with_CUDA_7.5 path (partially applied upstream).
   * Re-enable VERBS and OpenMPI build even CUDA is not enabled.
   * Minor adaptations of configure-expect.sh script for updated Bazel wizard.
Author: Adam Cecile <acecile@le-vert.net>

---
Origin: upstream, https://github.com/tensorflow/tensorflow/issues/15196
Bug: https://github.com/tensorflow/tensorflow/issues/15196
Forwarded: not-needed
Reviewed-By: TF team
Last-Update: 2018-03-06

--- python-tensorflow-cuda-1.5.0.orig/tensorflow/compiler/xla/service/llvm_ir/kernel_support_library.cc
+++ python-tensorflow-cuda-1.5.0/tensorflow/compiler/xla/service/llvm_ir/kernel_support_library.cc
@@ -111,8 +111,15 @@ void KernelSupportLibrary::EmitAndCallOu
     ir_builder->SetInsertPoint(return_inst);
 
     std::vector<llvm::Value*> arg_values;
-    std::transform(function->arg_begin(), function->arg_end(),
-                   std::back_inserter(arg_values), std::addressof<llvm::Value>);
+    /*
+     * clang on OSX doesn't like std::transform or range for loop here.
+     * See https://github.com/tensorflow/tensorflow/issues/15196
+     */
+    for (llvm::Function::arg_iterator arg = function->arg_begin(),
+                                      arg_e = function->arg_end();
+         arg != arg_e; ++arg) {
+      arg_values.push_back(arg);
+    }
     if (null_arg_idx != -1) {
       arg_values.insert(arg_values.begin() + null_arg_idx, nullptr);
     }
