From f8e5cbf6c58fe2794172ba8b6a219e692fbddcec Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 12 Apr 2021 22:04:22 +0300 Subject: Suppress VC's bogus "requires the compiler to capture 'this'" warning --- bpkg/fetch-git.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bpkg/fetch-git.cxx b/bpkg/fetch-git.cxx index 6a1eadb..0c21af6 100644 --- a/bpkg/fetch-git.cxx +++ b/bpkg/fetch-git.cxx @@ -1537,7 +1537,13 @@ namespace bpkg cstrings ()), v, "origin", - remapped_refspecs ? *remapped_refspecs : refspecs)) + // + // Note that has_value() is used here to work around bogus + // "requires the compiler to capture 'this'" VC warning. + // + (remapped_refspecs.has_value () + ? *remapped_refspecs + : refspecs))) fail << "unable to fetch " << dir << endg; // If we fetched shallow then let's make sure that the method we use to -- cgit v1.1