From bab5f9b799e5b64c59ad9c78070a4254fe9ceeab Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 19 Apr 2017 02:28:27 +0300 Subject: Fix parameter pack expansion in process_start() for Clang --- butl/process-run.txx | 9 +++++++-- tests/process-run/testscript | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/butl/process-run.txx b/butl/process-run.txx index 4437488..9de601f 100644 --- a/butl/process-run.txx +++ b/butl/process-run.txx @@ -58,9 +58,14 @@ namespace butl small_vector cmd; cmd.push_back (pp.recall_string ()); + auto call = [&cmd] (const auto& x, std::string& s) -> const char* + { + process_args_as (cmd, x, s); + return nullptr; + }; + std::string storage[args_size != 0 ? args_size : 1]; - const char* dummy[] = { - nullptr, (process_args_as (cmd, args, storage[index]), nullptr)... }; + const char* dummy[] = {nullptr, call (args, storage[index])... }; cmd.push_back (dummy[0]); // NULL (and get rid of unused warning). diff --git a/tests/process-run/testscript b/tests/process-run/testscript index 49abac4..318d548 100644 --- a/tests/process-run/testscript +++ b/tests/process-run/testscript @@ -2,8 +2,8 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -$* -p >>"EOO" 2>>EOE -$0 -c +$* -p >>/~%EOO% 2>>EOE +%.+/driver(\.exe)? -c% abc abc abc -- cgit v1.1