From 653c4e439bbd7649f7e508ed56e54e8d78b5e777 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 3 Jun 2019 21:51:06 +0200 Subject: [PATCH] Fix clang compilation error https://hydra.nixos.org/build/94332344 https://stackoverflow.com/questions/46114214/lambda-implicit-capture-fails-with-variable-declared-from-structured-binding --- src/libexpr/primops/flakeref.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libexpr/primops/flakeref.cc b/src/libexpr/primops/flakeref.cc index 6c90c3b64..24af09124 100644 --- a/src/libexpr/primops/flakeref.cc +++ b/src/libexpr/primops/flakeref.cc @@ -60,7 +60,8 @@ FlakeRef::FlakeRef(const std::string & uri_, bool allowRelative) static std::regex subDirRegex2(subDirRegex, std::regex::ECMAScript); - auto [uri, params] = splitUriAndParams(uri_); + auto [uri2, params] = splitUriAndParams(uri_); + std::string uri(uri2); auto handleSubdir = [&](const std::string & name, const std::string & value) { if (name == "dir") {