From 1a26afab049bb75c0523a754d62b961439248d44 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 5 Sep 2022 23:51:15 -0400 Subject: [PATCH] fixi: include windows 2022 (#748) * ci: include windows 2022 * fix visual studio 2022 issue with std::array and type detection * style: pre-commit.ci fixes * warning fixes Co-authored-by: Philip Top Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Philip Top --- azure-pipelines.yml | 10 +++++++--- include/CLI/TypeTools.hpp | 3 ++- tests/HelpersTest.cpp | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c519e153..d9e44872 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -57,10 +57,14 @@ jobs: Windows11: vmImage: "windows-2019" cli11.std: 11 - WindowsLatest: - vmImage: "windows-2019" + Windows20: + vmImage: "windows-2022" cli11.std: 20 - cli11.options: -DCMAKE_CXX_FLAGS="/std:c++latest /EHsc" + cli11.options: -DCMAKE_CXX_FLAGS="/EHsc" + WindowsLatest: + vmImage: "windows-2022" + cli11.std: 23 + cli11.options: -DCMAKE_CXX_FLAGS="/EHsc" Linux17nortti: vmImage: "ubuntu-latest" cli11.std: 17 diff --git a/include/CLI/TypeTools.hpp b/include/CLI/TypeTools.hpp index e3c97b17..2048a014 100644 --- a/include/CLI/TypeTools.hpp +++ b/include/CLI/TypeTools.hpp @@ -655,7 +655,8 @@ struct classify_object< typename std::enable_if::value && ((type_count::value >= 2 && !is_wrapper::value) || (uncommon_type::value && !is_direct_constructible::value && - !is_direct_constructible::value))>::type> { + !is_direct_constructible::value) || + (uncommon_type::value && type_count::value >= 2))>::type> { static constexpr object_category value{object_category::tuple_value}; // the condition on this class requires it be like a tuple, but on some compilers (like Xcode) tuples can be // constructed from just the first element so tuples of can be constructed from a string, which diff --git a/tests/HelpersTest.cpp b/tests/HelpersTest.cpp index 798a6d13..44e15520 100644 --- a/tests/HelpersTest.cpp +++ b/tests/HelpersTest.cpp @@ -1228,6 +1228,8 @@ TEST_CASE("Types: LexicalConversionTuple3", "[helpers]") { TEST_CASE("Types: LexicalConversionTuple4", "[helpers]") { CLI::results_t input = {"9.12", "19", "18.6", "5.87"}; std::array x; + auto tsize = CLI::detail::type_count::value; + CHECK(tsize == 4); bool res = CLI::detail::lexical_conversion(input, x); CHECK(res); CHECK(19 == Approx(std::get<1>(x)));