From f59731bf987812b09b1ea389f4deed940aaa4519 Mon Sep 17 00:00:00 2001 From: Luke Elliott Date: Sun, 12 Mar 2023 17:10:53 +0000 Subject: [PATCH] tuplet: fix bad code generation. https://github.com/codeinred/tuplet/issues/29 --- recipes/tuplet/all/conandata.yml | 5 +++ recipes/tuplet/all/conanfile.py | 7 +++-- ...round-cl-17.1-fold-expression-issues.patch | 31 +++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 recipes/tuplet/all/patches/0001-fix-workaround-cl-17.1-fold-expression-issues.patch diff --git a/recipes/tuplet/all/conandata.yml b/recipes/tuplet/all/conandata.yml index 98eee37c105c5f..eea56d962b7775 100644 --- a/recipes/tuplet/all/conandata.yml +++ b/recipes/tuplet/all/conandata.yml @@ -8,3 +8,8 @@ sources: "1.2.2": url: "https://github.com/codeinred/tuplet/archive/refs/tags/v1.2.2.tar.gz" sha256: "8605abf16f3ffcf87b0a5d81bc30f75b1fb478a5d747749fca31397e8705f8bc" +patches: + "2.1.0": + - patch_file: "patches/0001-fix-workaround-cl-17.1-fold-expression-issues.patch" + patch_description: "fix bad code generation with VS2022 c++20, tuplet issue #29" + patch_type: "conan" diff --git a/recipes/tuplet/all/conanfile.py b/recipes/tuplet/all/conanfile.py index e4ef08ece551c8..bafad995898938 100644 --- a/recipes/tuplet/all/conanfile.py +++ b/recipes/tuplet/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd -from conan.tools.files import copy, get +from conan.tools.files import export_conandata_patches, apply_conandata_patches, copy, get from conan.tools.layout import basic_layout from conan.tools.scm import Version import os @@ -41,6 +41,9 @@ def _compilers_minimum_version(self): "apple-clang": "12" } + def export_sources(self): + export_conandata_patches(self) + def package_id(self): self.info.clear() @@ -70,7 +73,7 @@ def source(self): destination=self.source_folder, strip_root=True) def build(self): - pass + apply_conandata_patches(self) def package(self): include_folder = os.path.join(self.source_folder, "include") diff --git a/recipes/tuplet/all/patches/0001-fix-workaround-cl-17.1-fold-expression-issues.patch b/recipes/tuplet/all/patches/0001-fix-workaround-cl-17.1-fold-expression-issues.patch new file mode 100644 index 00000000000000..395a11a0efbbfd --- /dev/null +++ b/recipes/tuplet/all/patches/0001-fix-workaround-cl-17.1-fold-expression-issues.patch @@ -0,0 +1,31 @@ +From b8a5bb75e44482eddc9bdfa04c7aed56d6d46b59 Mon Sep 17 00:00:00 2001 +From: Luke Elliott +Date: Sun, 12 Mar 2023 16:55:14 +0000 +Subject: [PATCH] fix: workaround cl 17.1 fold expression issues. + +#29 +--- + include/tuplet/tuple.hpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/include/tuplet/tuple.hpp b/include/tuplet/tuple.hpp +index 749d32a..f385e9f 100644 +--- a/include/tuplet/tuple.hpp ++++ b/include/tuplet/tuple.hpp +@@ -895,9 +895,12 @@ namespace tuplet { + + template + constexpr void _assign_tup(U&& u, type_list, type_list) { ++ // Not: (void(B1::value = static_cast(u).identity_t::value), ...); + // See: + // https://developercommunity.visualstudio.com/t/fold-expressions-unreliable-in-171-with-c20/1676476 +- (void(B1::value = static_cast(u).identity_t::value), ...); ++ // https://github.com/codeinred/tuplet/issues/21 ++ // https://github.com/codeinred/tuplet/issues/29 ++ (void(B1::value = std::forward>(u).value), ...); + } + template + constexpr void _assign_index_tup(U&& u, std::index_sequence) { +-- +2.39.2.windows.1 +