From e6cfd4e69b696d243ae2d96ab880279bf27c9c9c Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 10 Aug 2021 13:54:39 +0200 Subject: [PATCH 1/5] build: clang-13 support added --- example/kalman_filter/kalman.h | 2 +- src/core/include/units/bits/external/hacks.h | 23 +++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/example/kalman_filter/kalman.h b/example/kalman_filter/kalman.h index 3e416a8b..f78cc289 100644 --- a/example/kalman_filter/kalman.h +++ b/example/kalman_filter/kalman.h @@ -75,7 +75,7 @@ public: uncertainty_type uncertainty; }; -#if UNITS_COMP_CLANG == 12 || UNITS_COMP_MSVC +#if UNITS_COMP_CLANG <= 13 || UNITS_COMP_MSVC template estimation(state, U) -> estimation; diff --git a/src/core/include/units/bits/external/hacks.h b/src/core/include/units/bits/external/hacks.h index 847293f5..20579827 100644 --- a/src/core/include/units/bits/external/hacks.h +++ b/src/core/include/units/bits/external/hacks.h @@ -66,9 +66,10 @@ #endif -#if UNITS_COMP_CLANG == 12 && UNITS_LIBCXX +#if UNITS_LIBCXX + +#if UNITS_COMP_CLANG == 12 -#include #include #include #include @@ -76,6 +77,12 @@ #include #include +#elif UNITS_COMP_CLANG == 13 + +#include + +#endif + #endif #include @@ -99,7 +106,9 @@ namespace std { template concept default_constructible = constructible_from; -#elif UNITS_COMP_CLANG && UNITS_LIBCXX +#elif UNITS_LIBCXX + +#if UNITS_COMP_CLANG == 12 // concepts using concepts::common_with; @@ -209,6 +218,14 @@ constexpr bool in_range(T t) noexcept std::cmp_less_equal(t, std::numeric_limits::max()); } +#elif UNITS_COMP_CLANG == 13 + +using concepts::three_way_comparable; +using concepts::three_way_comparable_with; +using ::ranges::compare_three_way; + +#endif + #endif } // namespace std From 2986846cd1774a59ba0b4189c7c33e21d30ff118 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 10 Aug 2021 14:16:41 +0200 Subject: [PATCH 2/5] ci: clang-13 CI added --- .github/workflows/ci-conan.yml | 6 ++++++ .github/workflows/ci-test-package-cmake.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index 569d4458..4e60e8f9 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -61,6 +61,12 @@ jobs: compiler: { type: CLANG, version: 12, cc: "clang-12", cxx: "clang++-12" }, lib: "libc++" } + - { + name: "Ubuntu Clang 13.0.0 + libc++", + os: ubuntu-20.04, + compiler: { type: CLANG, version: 13, cc: "clang-13", cxx: "clang++-13" }, + lib: "libc++" + } # In case a Conan docker image will be needed to provide a specific configuration we can use a Docker image as follows # - { # name: "Ubuntu GCC 10.2.0", diff --git a/.github/workflows/ci-test-package-cmake.yml b/.github/workflows/ci-test-package-cmake.yml index e97c43fa..af3b3bf4 100644 --- a/.github/workflows/ci-test-package-cmake.yml +++ b/.github/workflows/ci-test-package-cmake.yml @@ -65,6 +65,12 @@ jobs: compiler: { type: CLANG, version: 12, cc: "clang-12", cxx: "clang++-12" }, lib: "libc++" } + - { + name: "Ubuntu Clang 13.0.0 + libc++", + os: ubuntu-20.04, + compiler: { type: CLANG, version: 13, cc: "clang-13", cxx: "clang++-13" }, + lib: "libc++" + } # In case a Conan docker image will be needed to provide a specific configuration we can use a Docker image as follows # - { # name: "Ubuntu GCC 10.2.0", From 6b8cd399d5c70e6e16ad12fcdbac5c8ec236cae4 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 10 Aug 2021 14:22:47 +0200 Subject: [PATCH 3/5] ci: libunwind installation added for libc++ configurations --- .github/workflows/ci-conan.yml | 2 +- .github/workflows/ci-test-package-cmake.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index 4e60e8f9..ab41b8e1 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -95,7 +95,7 @@ jobs: if: matrix.config.compiler.type == 'CLANG' && matrix.config.lib == 'libc++' shell: bash run: | - sudo apt install -y libc++-${{ matrix.config.compiler.version }}-dev libc++abi-${{ matrix.config.compiler.version }}-dev + sudo apt install -y libc++-${{ matrix.config.compiler.version }}-dev libc++abi-${{ matrix.config.compiler.version }}-dev libunwind-${{ matrix.config.compiler.version }}-dev - name: Install Ninja # TODO Find a proper syntax to make the below work # if: !matrix.config.docker_image diff --git a/.github/workflows/ci-test-package-cmake.yml b/.github/workflows/ci-test-package-cmake.yml index af3b3bf4..26da1b88 100644 --- a/.github/workflows/ci-test-package-cmake.yml +++ b/.github/workflows/ci-test-package-cmake.yml @@ -111,7 +111,7 @@ jobs: if: matrix.config.compiler.type == 'CLANG' && matrix.config.lib == 'libc++' shell: bash run: | - sudo apt install -y libc++-${{ matrix.config.compiler.version }}-dev libc++abi-${{ matrix.config.compiler.version }}-dev + sudo apt install -y libc++-${{ matrix.config.compiler.version }}-dev libc++abi-${{ matrix.config.compiler.version }}-dev libunwind-${{ matrix.config.compiler.version }}-dev - name: Install Ninja # TODO Find a proper syntax to make the below work # if: !matrix.config.docker_image From 1530d1f6a3fec0f272b14d9b0a57489df9d8d824 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 10 Aug 2021 14:33:48 +0200 Subject: [PATCH 4/5] ci: clang-13 support added for Conan --- .github/workflows/ci-conan.yml | 6 ++++++ .github/workflows/ci-test-package-cmake.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index ab41b8e1..1525ed23 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -126,6 +126,12 @@ jobs: conan profile update settings.compiler.libcxx=${{ matrix.config.lib }} default fi conan profile show default + - name: Add support for clang-13 to Conan's settings.yml + # TODO Remove when Conan will support clang-13 + if: matrix.config.compiler.type == 'CLANG' + shell: bash + run: | + sed -i -e 's/"8", "9", "10", "11", "12"]/"8", "9", "10", "11", "12", "13"]/' ~/.conan/settings.yml - name: Run Conan Package Tools shell: bash env: diff --git a/.github/workflows/ci-test-package-cmake.yml b/.github/workflows/ci-test-package-cmake.yml index 26da1b88..f3342aa1 100644 --- a/.github/workflows/ci-test-package-cmake.yml +++ b/.github/workflows/ci-test-package-cmake.yml @@ -144,6 +144,12 @@ jobs: conan profile update settings.compiler.libcxx=${{ matrix.config.lib }} default fi conan profile show default + - name: Add support for clang-13 to Conan's settings.yml + # TODO Remove when Conan will support clang-13 + if: matrix.config.compiler.type == 'CLANG' + shell: bash + run: | + sed -i -e 's/"8", "9", "10", "11", "12"]/"8", "9", "10", "11", "12", "13"]/' ~/.conan/settings.yml - name: Install Conan dependencies shell: bash run: | From 64edac75a738f8d79638708bf4e276f9349d08db Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 10 Aug 2021 14:37:03 +0200 Subject: [PATCH 5/5] docs: "Quantity References" chapter fixed --- docs/framework/quantities.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/framework/quantities.rst b/docs/framework/quantities.rst index ea880ac2..9ad71b36 100644 --- a/docs/framework/quantities.rst +++ b/docs/framework/quantities.rst @@ -121,13 +121,19 @@ They are defined using the `reference` class template:: namespace length_references { inline constexpr auto km = reference{}; - inline constexpr auto h = reference{}; } // namespace length_references + namespace time_references { + + inline constexpr auto h = reference{}; + + } // namespace time_references + namespace references { using namespace length_references; + using namespace time_references; } // namespace references